apply-clients 3.3.81 → 3.3.83

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.
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <!--<v-select :options='options' placeholder='请选择'-->
3
+ <!-- :value.sync="selectres"-->
4
+ <!-- :multiple="isMul"-->
5
+ <!-- :search="issearch"-->
6
+ <!-- :close-on-select="!isMul"-->
7
+ <!-- @change="resChange"-->
8
+ <!-- :value-single="true"-->
9
+ <!--&gt;-->
10
+ <!--</v-select>-->
11
+ <area-select :options='options' placeholder='请选择'
12
+ :value.sync="selectres"
13
+ :multiple="!isMul"
14
+ :search="issearch"
15
+ :close-on-select="isMul"
16
+ @change="resChange"
17
+ :value-single="true"
18
+ >
19
+ </area-select>
20
+ </template>
21
+ <script>
22
+ import {HttpResetClass} from 'vue-client'
23
+
24
+ export default {
25
+ title: '资源管理',
26
+ props: {
27
+
28
+ //资源类型
29
+ restype:'',
30
+ //资源数据
31
+ resObj:{},
32
+ options:[],
33
+ isMul: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ issearch: {
38
+ type: Boolean,
39
+ default: true
40
+ },
41
+ //资源初始化数据 默认选中值
42
+ initresid: {
43
+ type: Array,
44
+ default() { return [] },
45
+ },
46
+ //父层id
47
+ parentresid: {
48
+ type: Array,
49
+ default() { return [] },
50
+ },
51
+ },
52
+ data () {
53
+ return {
54
+ //资源数据
55
+ resObj:{},
56
+ //资源数据列表
57
+ resoptions:[],
58
+ //选中资源数据
59
+ selectres: [],
60
+ }
61
+ },
62
+ ready () {
63
+ //获取资源列表
64
+ this.getResList()
65
+ },
66
+ methods:{
67
+ //资源改变
68
+ resChange(val){
69
+ let orgnames=[]
70
+ Object.keys(this.options).forEach((key) => {
71
+ if(this.selectres.includes(this.options[key].value))
72
+ orgnames.push(this.options[key].label)
73
+ })
74
+ // console.log("资源变化:",this.selectres, orgnames,this.options)
75
+ this.$dispatch('res-select', this.selectres, orgnames,this.options)
76
+ },
77
+ //获取资源数据
78
+ async getResList() {
79
+ this.dealdata()
80
+ },
81
+ dealdata(){
82
+ //赋值资源数据选中初始值
83
+ let arryselect=[]
84
+ this.options.forEach((item) => {
85
+ if(this.initresid.length>0){
86
+ this.initresid.forEach((init) => {
87
+ if(item.value==init){
88
+ arryselect.push(item.value)
89
+ }
90
+ })
91
+ }
92
+ })
93
+ //赋值资源选中初始值
94
+ this.selectres=arryselect
95
+ }
96
+ },
97
+ watch: {
98
+ //监听初始化资源id
99
+ 'initresid.length'(){
100
+ this.dealdata()
101
+ },
102
+ //监听初始化资源id
103
+ 'parentresid'(){
104
+ this.dealdata()
105
+ },
106
+ },
107
+ }
108
+ </script>
@@ -0,0 +1,135 @@
1
+ <template>
2
+ <div :class="style">
3
+ <label :class="labelstyle" :style="shijifontColors">市&emsp;&emsp;县</label>
4
+ <app-res-area-select
5
+ :options = options
6
+ @res-select="getXian"
7
+ :issearch = "false"
8
+ >
9
+ </app-res-area-select>
10
+ </div>
11
+ <div :class="style">
12
+ <label :class="labelstyle" :style="xianfontColors">街道乡镇</label>
13
+ <app-res-area-select
14
+ :options = xian_options
15
+ @res-select="getjdao"
16
+ :issearch = "false"
17
+ >
18
+ </app-res-area-select>
19
+ </div>
20
+ <div :class="style">
21
+ <label :class="labelstyle" :style="shequfontColors">社&emsp;&emsp;区</label>
22
+ <app-res-area-select
23
+ :options = jdao_options
24
+ @res-select="getshequ"
25
+ :issearch = "false"
26
+ >
27
+ </app-res-area-select>
28
+ </div>
29
+ </template>
30
+ <script>
31
+
32
+ import { HttpResetClass } from 'vue-client'
33
+ import Vue from "vue";
34
+ export default {
35
+ title: '区域选择分组',
36
+ props: {
37
+ style: {
38
+ type: String,
39
+ default: 'col-xs-12 form-group app-input'
40
+ },
41
+ labelstyle: {
42
+ type: String,
43
+ default: 'font_normal_title'
44
+ },
45
+ mul: {
46
+ type: Boolean,
47
+ default: true
48
+ },
49
+ //初始值 默认选中值
50
+ initres: {
51
+ type: Object,
52
+ default: null,
53
+ }
54
+ },
55
+ data () {
56
+ return {
57
+ options:[],
58
+ initres: [],
59
+ xianginitres: [],
60
+ jdaoinitres: [],
61
+ xian_options:[],
62
+ jdao_options:[],
63
+ shijifontColors:"color: #cd5c5c",//红色
64
+ xianfontColors:"color: #cd5c5c",//红色
65
+ shequfontColors:"color: #cd5c5c",//红色
66
+ pubColors:"color: #0c2e4d",// 黑色
67
+ pub2Colors:"color: #cd5c5c"// 红色
68
+ }
69
+ },
70
+ ready () {
71
+ this.getResList();
72
+ },
73
+ methods:{
74
+ //获取区域地址
75
+ async getResList() {
76
+ let http = new HttpResetClass()
77
+ let req = await http.load('POST', '/rs/logic/resAreaSelect', {
78
+ userid: Vue.user.id,
79
+ orgid: Vue.user.orgid
80
+ }, {resolveMsg: null, rejectMsg: '获取区域地址失败'})
81
+ this.options = []
82
+ this.options = req.data
83
+ },
84
+ async getXian(value,lable,obj) {
85
+ this.xian_options = []
86
+ this.jdao_options = []
87
+ let newFilArr = obj.filter( (item,i) =>{
88
+ if(item.value == value){
89
+ return item
90
+ }
91
+ } )
92
+ if (newFilArr.length>0){
93
+ this.xian_options = newFilArr[0].children
94
+ }
95
+ if (value !=null && value.length!=0){
96
+ this.shijifontColors = this.pubColors
97
+ }else {
98
+ this.shijifontColors = this.pub2Colors
99
+ this.xianfontColors = this.pub2Colors
100
+ this.shequfontColors = this.pub2Colors
101
+ }
102
+ this.$dispatch('shiji-select', value, lable)
103
+ },
104
+ async getjdao(value,lable,obj) {
105
+ this.jdao_options = []
106
+ let newFilArr = obj.filter( (item,i) =>{
107
+ if(item.value == value){
108
+ return item
109
+ }
110
+ } )
111
+ if (newFilArr.length>0){
112
+ this.jdao_options = newFilArr[0].children
113
+ }
114
+ if (value !=null && value.length!=0){
115
+ this.xianfontColors = this.pubColors
116
+ }else {
117
+ this.xianfontColors = this.pub2Colors
118
+ this.shequfontColors = this.pub2Colors
119
+ }
120
+ this.$dispatch('xian-select',value, lable)
121
+ },
122
+ async getshequ(value,lable,obj) {
123
+ if (value !=null && value.length!=0){
124
+ this.shequfontColors = this.pubColors
125
+ }else {
126
+ this.shequfontColors = this.pub2Colors
127
+ }
128
+ this.$dispatch('shequ-select',value, lable)
129
+ }
130
+ },
131
+ watch: {
132
+
133
+ }
134
+ }
135
+ </script>