system-clients 4.0.12 → 4.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "system-clients",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
4
4
  "description": "系统基础框架",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -63,7 +63,7 @@
63
63
  // let res = yield self.$resetpost('/rs/db/modifypwd', {data: self.deliver})
64
64
  // Util.f.password = self.deliver.newpassword
65
65
  // todo v4
66
- let res = yield self.$resetpost('/rs/user/modifypwd', {data: self.deliver }, {resolveMsg: null,rejectMsg: null})
66
+ let res = yield self.$resetpost('/api/af-system/user/modifypwd', {data: self.deliver }, {resolveMsg: null,rejectMsg: null})
67
67
  self.$login.f.password = self.deliver.newpassword
68
68
  if (res.data) {
69
69
  console.log("修改密码返回:" , res.data)
@@ -1,186 +1,186 @@
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
- if (val.name !== '组织机构' && parentname !== '资源管理'){
84
- this.resoptions.push({label: parentname === '组织机构' ? val.name : val.name+' - '+parentname, value: val.id})
85
- }
86
- parentname=parentname+val.name
87
- this.treetoList(val,parentname)
88
- }else {
89
- //截取组织机构【组织机构】
90
- if(this.restype=='organization'){
91
- parentname=parentname.replace("组织机构","")
92
- this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
93
- } else if (this.restype == 'department') {
94
- if (this.specialquery) {
95
- if (val.f_dep_type === '营业厅') {
96
- this.resoptions.push({label: val.name, value: val.id})
97
- }
98
- } else {
99
- if (this.$login.r.includes('部门默认选中') && this.$login.r.includes('限制查询当前部门')) {
100
- if (val.id == this.initresid[0]) {
101
- this.resoptions.push({label: val.name, value: val.id})
102
- }
103
- } else {
104
- this.resoptions.push({label: val.name, value: val.id})
105
- }
106
- }
107
- } else {
108
- this.resoptions.push({label: val.name, value: val.id})
109
- }
110
- }
111
- },
112
- //检查id是否存在
113
- checkidres(val){
114
- let flag=false
115
- //如果没传值得话 不过滤
116
- if(this.parentresid.length==0&&this.restype=='organization'){
117
- flag=true
118
- }
119
- this.parentresid.forEach((item) => {
120
- if(item==val.id){
121
- flag=true
122
- }
123
- })
124
- return flag;
125
- },
126
- //资源改变
127
- resChange(val){
128
- let orgnames=[]
129
- Object.keys(this.resoptions).forEach((key) => {
130
- if(this.selectres.includes(this.resoptions[key].value))
131
- orgnames.push(this.resoptions[key].label)
132
- })
133
- console.log('资源改变。。', val, orgnames)
134
- this.$dispatch('res-select', this.selectres, orgnames)
135
- },
136
- //获取资源数据
137
- async getResList() {
138
-
139
- let http = new HttpResetClass()
140
-
141
- let req = await http.load('POST', '/rs/search', {data: {
142
- source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
143
- userid: this.$login.f.id
144
- }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
145
- this.resObj=req.data[0]
146
- this.dealdata()
147
- },
148
- dealdata(){
149
- this.resoptions=[]
150
- this.findById(this.resObj);
151
- //赋值资源数据
152
- let arryselect=[]
153
- this.resoptions.forEach((item) => {
154
- if(this.initresid.length>0){
155
- this.initresid.forEach((init) => {
156
- if(item.value==init){
157
- arryselect.push(item.value)
158
- }
159
- })
160
- }
161
- })
162
- //赋值资源选中初始值
163
- this.selectres=arryselect
164
- }
165
- },
166
- watch: {
167
- //监听初始化资源id
168
- 'initresid.length'() {
169
- this.dealdata()
170
- },
171
- //监听初始化资源id
172
- 'parentresid'() {
173
- this.dealdata()
174
- },
175
- initresid: {
176
- handler(newVal, oldVal) {
177
- // 避免重复触发
178
- if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
179
- return;
180
- }
181
- this.dealdata();
182
- },
183
- }
184
- }
185
- }
186
- </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
+ if (val.name !== '组织机构' && parentname !== '资源管理'){
84
+ this.resoptions.push({label: parentname === '组织机构' ? val.name : val.name+' - '+parentname, value: val.id})
85
+ }
86
+ parentname=parentname+val.name
87
+ this.treetoList(val,parentname)
88
+ }else {
89
+ //截取组织机构【组织机构】
90
+ if(this.restype=='organization'){
91
+ parentname=parentname.replace("组织机构","")
92
+ this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
93
+ } else if (this.restype == 'department') {
94
+ if (this.specialquery) {
95
+ if (val.f_dep_type === '营业厅') {
96
+ this.resoptions.push({label: val.name, value: val.id})
97
+ }
98
+ } else {
99
+ if (this.$login.r.includes('部门默认选中') && this.$login.r.includes('限制查询当前部门')) {
100
+ if (val.id == this.initresid[0]) {
101
+ this.resoptions.push({label: val.name, value: val.id})
102
+ }
103
+ } else {
104
+ this.resoptions.push({label: val.name, value: val.id})
105
+ }
106
+ }
107
+ } else {
108
+ this.resoptions.push({label: val.name, value: val.id})
109
+ }
110
+ }
111
+ },
112
+ //检查id是否存在
113
+ checkidres(val){
114
+ let flag=false
115
+ //如果没传值得话 不过滤
116
+ if(this.parentresid.length==0&&this.restype=='organization'){
117
+ flag=true
118
+ }
119
+ this.parentresid.forEach((item) => {
120
+ if(item==val.id){
121
+ flag=true
122
+ }
123
+ })
124
+ return flag;
125
+ },
126
+ //资源改变
127
+ resChange(val){
128
+ let orgnames=[]
129
+ Object.keys(this.resoptions).forEach((key) => {
130
+ if(this.selectres.includes(this.resoptions[key].value))
131
+ orgnames.push(this.resoptions[key].label)
132
+ })
133
+ console.log('资源改变。。', val, orgnames)
134
+ this.$dispatch('res-select', this.selectres, orgnames)
135
+ },
136
+ //获取资源数据
137
+ async getResList() {
138
+
139
+ let http = new HttpResetClass()
140
+
141
+ let req = await http.load('POST', '/rs/search', {data: {
142
+ source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
143
+ userid: this.$login.f.id
144
+ }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
145
+ this.resObj=req.data[0]
146
+ this.dealdata()
147
+ },
148
+ dealdata(){
149
+ this.resoptions=[]
150
+ this.findById(this.resObj);
151
+ //赋值资源数据
152
+ let arryselect=[]
153
+ this.resoptions.forEach((item) => {
154
+ if(this.initresid.length>0){
155
+ this.initresid.forEach((init) => {
156
+ if(item.value==init){
157
+ arryselect.push(item.value)
158
+ }
159
+ })
160
+ }
161
+ })
162
+ //赋值资源选中初始值
163
+ this.selectres=arryselect
164
+ }
165
+ },
166
+ watch: {
167
+ //监听初始化资源id
168
+ 'initresid.length'() {
169
+ this.dealdata()
170
+ },
171
+ //监听初始化资源id
172
+ 'parentresid'() {
173
+ this.dealdata()
174
+ },
175
+ initresid: {
176
+ handler(newVal, oldVal) {
177
+ // 避免重复触发
178
+ if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
179
+ return;
180
+ }
181
+ this.dealdata();
182
+ },
183
+ }
184
+ }
185
+ }
186
+ </script>
@@ -1,211 +1,211 @@
1
- <template>
2
- <div :class="style" v-show="companyshow">
3
- <label class="font_normal_body">公&emsp;&emsp;司</label>
4
- <right-tree @re-res="getorg"
5
- :mustselect="mustselect"
6
- :initresid='initres.org'></right-tree>
7
- </div>
8
- <div :class="style" v-show="departmentshow">
9
- <label class="font_normal_body">部&emsp;&emsp;门</label>
10
- <res-select restype='department' v-ref:department
11
- @res-select="getdep"
12
- :parentresid="depresid"
13
- :specialquery="specialquery"
14
- :initresid='initres.dep'
15
- :mustselect="mustselect"
16
- :is-mul="mul">
17
- </res-select>
18
- </div>
19
- <div :class="style" v-show="operatorshow && (!cascade)">
20
- <label class="font_normal_body">人&emsp;&emsp;员</label>
21
- <res-select restype='user'
22
- @res-select="getuser"
23
- :parentresid="depresid"
24
- :initresid='initres.user'
25
- :mustselect="mustselect"
26
- :is-mul="mul">
27
- </res-select>
28
- </div>
29
- <div :class="style" v-show="operatorshow && cascade">
30
- <label class="font_normal_body">人&emsp;&emsp;员</label>
31
- <res-select restype='user'
32
- @res-select="getuser"
33
- :parentresid="userresid"
34
- :initresid='initres.user'
35
- :mustselect="mustselect"
36
- :is-mul="mul">
37
- </res-select>
38
- </div>
39
- <div :class="style " v-if="sliceareashow" >
40
- <label class="font_normal_body">片&emsp;&emsp;区</label>
41
- <v-select :value.sync="slice_area" v-model="slice_area" @change='getarea'
42
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
43
- close-on-select v-ref:slice>
44
- </v-select>
45
- </div>
46
- </template>
47
- <script>
48
- import plugin from '../../plugins/GetLoginInfoService'
49
- import { HttpResetClass } from 'vue-client'
50
- export default {
51
- title: '资源选择测试',
52
- props: {
53
- style: {
54
- type: String,
55
- default: 'col-sm-2 form-group'
56
- },
57
- mul: {
58
- type: Boolean,
59
- default: true
60
- },
61
- //是否只查询营业厅
62
- specialquery: {
63
- type: Boolean,
64
- default: false
65
- },
66
- //初始值
67
- initres: {
68
- type: Object,
69
- default: null,
70
- },
71
- showComponent:{
72
- default:['company','department','operator','slicearea']
73
- },
74
- //人员是否和部门关联
75
- cascade: {
76
- type: Boolean,
77
- default: true
78
- },
79
- selectin: {
80
- type: Boolean,
81
- default: true
82
- }
83
- },
84
- data () {
85
- return {
86
- orgresid:[this.$login.f.orgid],
87
- depresid:[],
88
- userresid:[],
89
- operatorsid: [],
90
- sliceArea: [],
91
- slice_area:[],
92
- companyshow:false,
93
- departmentshow:false,
94
- operatorshow:false,
95
- sliceareashow:false,
96
- mustselect:false,
97
- obj:{
98
- orgnames:[],
99
- depnames:[],
100
- operatornames:[]
101
- }
102
- }
103
- },
104
- ready () {
105
- if(this.$login.r.includes('部门默认选中')&& this.selectin && this.showComponent.includes('department')){
106
- this.initres.dep = [this.$login.f.depids]
107
- }
108
- if(this.$login.r.includes('人员默认选中')&& this.selectin && this.showComponent.includes('operator')){
109
- this.initres.user = [this.$login.f.id]
110
- if(this.$login.r.includes('人员强制选中')){
111
- this.mustselect = true
112
- }
113
- }
114
- this.initComponent();
115
- this.initAreas(this.$login.f.orgid)
116
- },
117
- methods:{
118
- initComponent(){
119
- let self=this;
120
- this.showComponent.find((item)=>{
121
- switch(item){
122
- case 'company': self.companyshow=true; break;
123
- case 'department': self.departmentshow=true; break;
124
- case 'operator': self.operatorshow=true; break;
125
- case 'slicearea': self.sliceareashow=true; break;
126
- }
127
- })
128
- },
129
- // 初始化片区
130
- async initAreas (val) {
131
- if (val) {
132
- let http = new HttpResetClass()
133
- let getAllArea = await http.load('POST', '/rs/search', {
134
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
135
- userid: this.$login.f.id
136
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
137
- let arr = getAllArea.data.filter((res) => {
138
- if(Array.isArray(val)){
139
- for (let i = 0; i <val.length ; i++) {
140
- if(res.parentid == val[i]){
141
- return true
142
- }
143
- }
144
- }
145
- return res.parentid == val
146
- })
147
- this.sliceArea = []
148
- this.slice_area = []
149
- arr.forEach((res) => {
150
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
151
- })
152
- }
153
- },
154
- returnOrg(ids){
155
- let limit = this.$login.r.includes('数据授权限定')
156
-
157
- let condition;
158
- if(this.depresid.length > 0)
159
- condition = " and f_orgid in " + plugin.convertToIn(this.depresid);
160
- else
161
- condition = " and f_orgid = " + this.$login.f.orgid;
162
- if(this.userresid.length > 0){
163
- condition += " and f_depid in " + plugin.convertToIn(this.userresid);
164
- } else {
165
- if (limit && this.departmentshow && this.$refs.department) {
166
- let depids = []
167
- for (let row of this.$refs.department.resoptions) {
168
- depids.push(row.value)
169
- }
170
- let depid = depids.length ? plugin.convertToIn(depids) : `('')`
171
- condition += " and f_depid in " + depid;
172
- }
173
- }
174
- if(ids && ids.length > 0 && this.operatorshow){
175
- condition += " and f_operatorid in " + plugin.convertToIn(ids);
176
- }
177
- if(this.slice_area.length>0){
178
- condition += " and f_zones = '" + this.slice_area[0].name+"'"
179
- }
180
- this.$dispatch('re-res',condition,this.obj)
181
- },
182
- getorg (obj) {
183
- this.depresid=obj.resids
184
- this.obj.orgnames = obj.res
185
- this.initAreas(obj.resids)
186
- this.returnOrg();
187
- },
188
- getdep(obj,val) {
189
- this.obj.depnames = val
190
- this.userresid=obj
191
- this.returnOrg();
192
- },
193
- getuser(obj,val) {
194
- this.obj.operatornames = val
195
- this.operatorsid = obj
196
- this.returnOrg(obj);
197
- },
198
- getarea(val) {
199
- this.slice_area=val
200
- if(this.operatorsid){
201
- this.returnOrg(this.operatorsid);
202
- }else{
203
- this.returnOrg();
204
- }
205
- }
206
- },
207
- watch: {
208
-
209
- }
210
- }
211
- </script>
1
+ <template>
2
+ <div :class="style" v-show="companyshow">
3
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
4
+ <right-tree @re-res="getorg"
5
+ :mustselect="mustselect"
6
+ :initresid='initres.org'></right-tree>
7
+ </div>
8
+ <div :class="style" v-show="departmentshow">
9
+ <label class="font_normal_body">部&emsp;&emsp;门</label>
10
+ <res-select restype='department' v-ref:department
11
+ @res-select="getdep"
12
+ :parentresid="depresid"
13
+ :specialquery="specialquery"
14
+ :initresid='initres.dep'
15
+ :mustselect="mustselect"
16
+ :is-mul="mul">
17
+ </res-select>
18
+ </div>
19
+ <div :class="style" v-show="operatorshow && (!cascade)">
20
+ <label class="font_normal_body">人&emsp;&emsp;员</label>
21
+ <res-select restype='user'
22
+ @res-select="getuser"
23
+ :parentresid="depresid"
24
+ :initresid='initres.user'
25
+ :mustselect="mustselect"
26
+ :is-mul="mul">
27
+ </res-select>
28
+ </div>
29
+ <div :class="style" v-show="operatorshow && cascade">
30
+ <label class="font_normal_body">人&emsp;&emsp;员</label>
31
+ <res-select restype='user'
32
+ @res-select="getuser"
33
+ :parentresid="userresid"
34
+ :initresid='initres.user'
35
+ :mustselect="mustselect"
36
+ :is-mul="mul">
37
+ </res-select>
38
+ </div>
39
+ <div :class="style " v-if="sliceareashow" >
40
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
41
+ <v-select :value.sync="slice_area" v-model="slice_area" @change='getarea'
42
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
43
+ close-on-select v-ref:slice>
44
+ </v-select>
45
+ </div>
46
+ </template>
47
+ <script>
48
+ import plugin from '../../plugins/GetLoginInfoService'
49
+ import { HttpResetClass } from 'vue-client'
50
+ export default {
51
+ title: '资源选择测试',
52
+ props: {
53
+ style: {
54
+ type: String,
55
+ default: 'col-sm-2 form-group'
56
+ },
57
+ mul: {
58
+ type: Boolean,
59
+ default: true
60
+ },
61
+ //是否只查询营业厅
62
+ specialquery: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ //初始值
67
+ initres: {
68
+ type: Object,
69
+ default: null,
70
+ },
71
+ showComponent:{
72
+ default:['company','department','operator','slicearea']
73
+ },
74
+ //人员是否和部门关联
75
+ cascade: {
76
+ type: Boolean,
77
+ default: true
78
+ },
79
+ selectin: {
80
+ type: Boolean,
81
+ default: true
82
+ }
83
+ },
84
+ data () {
85
+ return {
86
+ orgresid:[this.$login.f.orgid],
87
+ depresid:[],
88
+ userresid:[],
89
+ operatorsid: [],
90
+ sliceArea: [],
91
+ slice_area:[],
92
+ companyshow:false,
93
+ departmentshow:false,
94
+ operatorshow:false,
95
+ sliceareashow:false,
96
+ mustselect:false,
97
+ obj:{
98
+ orgnames:[],
99
+ depnames:[],
100
+ operatornames:[]
101
+ }
102
+ }
103
+ },
104
+ ready () {
105
+ if(this.$login.r.includes('部门默认选中')&& this.selectin && this.showComponent.includes('department')){
106
+ this.initres.dep = [this.$login.f.depids]
107
+ }
108
+ if(this.$login.r.includes('人员默认选中')&& this.selectin && this.showComponent.includes('operator')){
109
+ this.initres.user = [this.$login.f.id]
110
+ if(this.$login.r.includes('人员强制选中')){
111
+ this.mustselect = true
112
+ }
113
+ }
114
+ this.initComponent();
115
+ this.initAreas(this.$login.f.orgid)
116
+ },
117
+ methods:{
118
+ initComponent(){
119
+ let self=this;
120
+ this.showComponent.find((item)=>{
121
+ switch(item){
122
+ case 'company': self.companyshow=true; break;
123
+ case 'department': self.departmentshow=true; break;
124
+ case 'operator': self.operatorshow=true; break;
125
+ case 'slicearea': self.sliceareashow=true; break;
126
+ }
127
+ })
128
+ },
129
+ // 初始化片区
130
+ async initAreas (val) {
131
+ if (val) {
132
+ let http = new HttpResetClass()
133
+ let getAllArea = await http.load('POST', '/rs/search', {
134
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
135
+ userid: this.$login.f.id
136
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
137
+ let arr = getAllArea.data.filter((res) => {
138
+ if(Array.isArray(val)){
139
+ for (let i = 0; i <val.length ; i++) {
140
+ if(res.parentid == val[i]){
141
+ return true
142
+ }
143
+ }
144
+ }
145
+ return res.parentid == val
146
+ })
147
+ this.sliceArea = []
148
+ this.slice_area = []
149
+ arr.forEach((res) => {
150
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
151
+ })
152
+ }
153
+ },
154
+ returnOrg(ids){
155
+ let limit = this.$login.r.includes('数据授权限定')
156
+
157
+ let condition;
158
+ if(this.depresid.length > 0)
159
+ condition = " and f_orgid in " + plugin.convertToIn(this.depresid);
160
+ else
161
+ condition = " and f_orgid = " + this.$login.f.orgid;
162
+ if(this.userresid.length > 0){
163
+ condition += " and f_depid in " + plugin.convertToIn(this.userresid);
164
+ } else {
165
+ if (limit && this.departmentshow && this.$refs.department) {
166
+ let depids = []
167
+ for (let row of this.$refs.department.resoptions) {
168
+ depids.push(row.value)
169
+ }
170
+ let depid = depids.length ? plugin.convertToIn(depids) : `('')`
171
+ condition += " and f_depid in " + depid;
172
+ }
173
+ }
174
+ if(ids && ids.length > 0 && this.operatorshow){
175
+ condition += " and f_operatorid in " + plugin.convertToIn(ids);
176
+ }
177
+ if(this.slice_area.length>0){
178
+ condition += " and f_zones = '" + this.slice_area[0].name+"'"
179
+ }
180
+ this.$dispatch('re-res',condition,this.obj)
181
+ },
182
+ getorg (obj) {
183
+ this.depresid=obj.resids
184
+ this.obj.orgnames = obj.res
185
+ this.initAreas(obj.resids)
186
+ this.returnOrg();
187
+ },
188
+ getdep(obj,val) {
189
+ this.obj.depnames = val
190
+ this.userresid=obj
191
+ this.returnOrg();
192
+ },
193
+ getuser(obj,val) {
194
+ this.obj.operatornames = val
195
+ this.operatorsid = obj
196
+ this.returnOrg(obj);
197
+ },
198
+ getarea(val) {
199
+ this.slice_area=val
200
+ if(this.operatorsid){
201
+ this.returnOrg(this.operatorsid);
202
+ }else{
203
+ this.returnOrg();
204
+ }
205
+ }
206
+ },
207
+ watch: {
208
+
209
+ }
210
+ }
211
+ </script>
@@ -1,189 +1,189 @@
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() {
36
- return []
37
- },
38
- },
39
- //父层id
40
- parentresid: {
41
- type: Array,
42
- default() {
43
- return []
44
- },
45
- },
46
- mustselect: {
47
- type: Boolean,
48
- default: false
49
- },
50
- },
51
- data() {
52
- return {
53
- //资源数据
54
- resObj: {},
55
- //资源数据列表
56
- resoptions: [],
57
- //选中资源数据
58
- selectres: [],
59
- }
60
- },
61
- ready() {
62
- //获取资源列表
63
- this.getResList()
64
- },
65
- methods: {
66
- //树形结构变成list
67
- findById(val) {
68
- if (val) {
69
- if (this.checkidres(val)) {
70
- this.treetoList(val, '')
71
- } else if (val.children.length > 0) {
72
- for (let value of val.children) {
73
- this.findById(value)
74
- }
75
- }
76
- }
77
- },
78
- //树形结构变成list
79
- treetoList(val, parentname) {
80
- for (let value of val.children) {
81
- this.ergodicList(value, parentname)
82
- }
83
- },
84
- //找到跟节点
85
- ergodicList(val, parentname) {
86
- if (val.children.length > 0) {
87
- parentname = parentname + val.name
88
- this.treetoList(val, parentname)
89
- } else {
90
- //截取组织机构【组织机构】
91
- if (this.restype == 'organization') {
92
- parentname = parentname.replace("组织机构", "")
93
- this.resoptions.push({label: val.name + ' - ' + parentname, value: val.id})
94
- } else if (this.restype == 'department') {
95
- if (this.specialquery) {
96
- if (val.f_dep_type === '营业厅') {
97
- this.resoptions.push({label: val.name, value: val.id})
98
- }
99
- } else {
100
- if (this.$login.r.includes('部门默认选中') && this.$login.r.includes('限制查询当前部门')) {
101
- if (val.id == this.initresid[0]) {
102
- this.resoptions.push({label: val.name, value: val.id})
103
- }
104
- } else {
105
- this.resoptions.push({label: val.name, value: val.id})
106
- }
107
- }
108
- } else {
109
- this.resoptions.push({label: val.name, value: val.id})
110
- }
111
- }
112
- },
113
- //检查id是否存在
114
- checkidres(val) {
115
- let flag = false
116
- //如果没传值得话 不过滤
117
- if (this.parentresid.length == 0 && this.restype == 'organization') {
118
- flag = true
119
- }
120
- this.parentresid.forEach((item) => {
121
- if (item == val.id) {
122
- flag = true
123
- }
124
- })
125
- return flag;
126
- },
127
- //资源改变
128
- resChange(val) {
129
- let orgnames = []
130
- Object.keys(this.resoptions).forEach((key) => {
131
- if (this.selectres.includes(this.resoptions[key].value))
132
- orgnames.push(this.resoptions[key].label)
133
- })
134
- console.log('资源改变。。', val, orgnames)
135
- this.$dispatch('res-select', this.selectres, orgnames)
136
- },
137
- //获取资源数据
138
- async getResList() {
139
-
140
- let http = new HttpResetClass()
141
-
142
- let req = await http.load('POST', '/rs/search', {
143
- data: {
144
- source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
145
- userid: this.$login.f.id
146
- }
147
- }, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
148
- this.resObj = req.data[0]
149
- this.dealdata()
150
- },
151
- dealdata() {
152
- this.resoptions = []
153
- this.findById(this.resObj);
154
- //赋值资源数据
155
- let arryselect = []
156
- this.resoptions.forEach((item) => {
157
- if (this.initresid.length > 0) {
158
- this.initresid.forEach((init) => {
159
- if (item.value == init) {
160
- arryselect.push(item.value)
161
- }
162
- })
163
- }
164
- })
165
- //赋值资源选中初始值
166
- this.selectres = arryselect
167
- }
168
- },
169
- watch: {
170
- //监听初始化资源id
171
- 'initresid.length'() {
172
- this.dealdata()
173
- },
174
- //监听初始化资源id
175
- 'parentresid'() {
176
- this.dealdata()
177
- },
178
- initresid: {
179
- handler(newVal, oldVal) {
180
- // 避免重复触发
181
- if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
182
- return;
183
- }
184
- this.dealdata();
185
- },
186
- }
187
- }
188
- }
189
- </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() {
36
+ return []
37
+ },
38
+ },
39
+ //父层id
40
+ parentresid: {
41
+ type: Array,
42
+ default() {
43
+ return []
44
+ },
45
+ },
46
+ mustselect: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ },
51
+ data() {
52
+ return {
53
+ //资源数据
54
+ resObj: {},
55
+ //资源数据列表
56
+ resoptions: [],
57
+ //选中资源数据
58
+ selectres: [],
59
+ }
60
+ },
61
+ ready() {
62
+ //获取资源列表
63
+ this.getResList()
64
+ },
65
+ methods: {
66
+ //树形结构变成list
67
+ findById(val) {
68
+ if (val) {
69
+ if (this.checkidres(val)) {
70
+ this.treetoList(val, '')
71
+ } else if (val.children.length > 0) {
72
+ for (let value of val.children) {
73
+ this.findById(value)
74
+ }
75
+ }
76
+ }
77
+ },
78
+ //树形结构变成list
79
+ treetoList(val, parentname) {
80
+ for (let value of val.children) {
81
+ this.ergodicList(value, parentname)
82
+ }
83
+ },
84
+ //找到跟节点
85
+ ergodicList(val, parentname) {
86
+ if (val.children.length > 0) {
87
+ parentname = parentname + val.name
88
+ this.treetoList(val, parentname)
89
+ } else {
90
+ //截取组织机构【组织机构】
91
+ if (this.restype == 'organization') {
92
+ parentname = parentname.replace("组织机构", "")
93
+ this.resoptions.push({label: val.name + ' - ' + parentname, value: val.id})
94
+ } else if (this.restype == 'department') {
95
+ if (this.specialquery) {
96
+ if (val.f_dep_type === '营业厅') {
97
+ this.resoptions.push({label: val.name, value: val.id})
98
+ }
99
+ } else {
100
+ if (this.$login.r.includes('部门默认选中') && this.$login.r.includes('限制查询当前部门')) {
101
+ if (val.id == this.initresid[0]) {
102
+ this.resoptions.push({label: val.name, value: val.id})
103
+ }
104
+ } else {
105
+ this.resoptions.push({label: val.name, value: val.id})
106
+ }
107
+ }
108
+ } else {
109
+ this.resoptions.push({label: val.name, value: val.id})
110
+ }
111
+ }
112
+ },
113
+ //检查id是否存在
114
+ checkidres(val) {
115
+ let flag = false
116
+ //如果没传值得话 不过滤
117
+ if (this.parentresid.length == 0 && this.restype == 'organization') {
118
+ flag = true
119
+ }
120
+ this.parentresid.forEach((item) => {
121
+ if (item == val.id) {
122
+ flag = true
123
+ }
124
+ })
125
+ return flag;
126
+ },
127
+ //资源改变
128
+ resChange(val) {
129
+ let orgnames = []
130
+ Object.keys(this.resoptions).forEach((key) => {
131
+ if (this.selectres.includes(this.resoptions[key].value))
132
+ orgnames.push(this.resoptions[key].label)
133
+ })
134
+ console.log('资源改变。。', val, orgnames)
135
+ this.$dispatch('res-select', this.selectres, orgnames)
136
+ },
137
+ //获取资源数据
138
+ async getResList() {
139
+
140
+ let http = new HttpResetClass()
141
+
142
+ let req = await http.load('POST', '/rs/search', {
143
+ data: {
144
+ source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
145
+ userid: this.$login.f.id
146
+ }
147
+ }, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
148
+ this.resObj = req.data[0]
149
+ this.dealdata()
150
+ },
151
+ dealdata() {
152
+ this.resoptions = []
153
+ this.findById(this.resObj);
154
+ //赋值资源数据
155
+ let arryselect = []
156
+ this.resoptions.forEach((item) => {
157
+ if (this.initresid.length > 0) {
158
+ this.initresid.forEach((init) => {
159
+ if (item.value == init) {
160
+ arryselect.push(item.value)
161
+ }
162
+ })
163
+ }
164
+ })
165
+ //赋值资源选中初始值
166
+ this.selectres = arryselect
167
+ }
168
+ },
169
+ watch: {
170
+ //监听初始化资源id
171
+ 'initresid.length'() {
172
+ this.dealdata()
173
+ },
174
+ //监听初始化资源id
175
+ 'parentresid'() {
176
+ this.dealdata()
177
+ },
178
+ initresid: {
179
+ handler(newVal, oldVal) {
180
+ // 避免重复触发
181
+ if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
182
+ return;
183
+ }
184
+ this.dealdata();
185
+ },
186
+ }
187
+ }
188
+ }
189
+ </script>
@@ -1,6 +1,6 @@
1
- // 分公司特殊组件页面注册
2
-
3
- let specialComp = {
4
- 'res-select': (resolve) => require(['./ResSelect.vue'], resolve)
5
- }
6
- exports.specialComp = specialComp
1
+ // 分公司特殊组件页面注册
2
+
3
+ let specialComp = {
4
+ 'res-select': (resolve) => require(['./ResSelect.vue'], resolve)
5
+ }
6
+ exports.specialComp = specialComp
File without changes
@@ -1,2 +0,0 @@
1
- #Thu Apr 17 15:32:17 CST 2025
2
- gradle.version=3.5.1