1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
| <template>
| <div v-if="display">
| <vciWebReferClassify
| :key="typeKey" :data-key="typeKey"
| :disabled="disabled"
| :referConfig="rConfig"
| :referType="referType"
| :text="textD"
| :title="titleD"
| :value="valueD"
| :width="width"
| :height="height"
| :reloadFormKey="reloadFormKey"
| @setReferValue="setValue">
| </vciWebReferClassify>
| </div>
| </template>
|
| <script>
| import vciWebReferClassify from "./vciWebReferClassify.vue";
| import {verifyNull} from "@/util/validate";
|
| export default {
| name: "orgUserRefer",
| props: {
| referConfig: {
| type: Object,
| }, value: {
| type: String,
| default: ''
| }, text: {
| type: String,
| default: ''
| }, disabled: {
| type: Boolean,
| default: false,
| }, display: {
| type: Boolean,
| default: true
| }, typeKey: {
| type: String,
| default: ''
| }, referType: {
| type: String,
| default:''
| }, width: {
| type: String,
| default:'70%'
| }, height: {
| type: String,
| default:'60%'
| },
| reloadFormKey: {
| type: String,
| default: '',
| }
| },
| components: {vciWebReferClassify },
| data() {
| return {
| emitData: {},
| };
| },
| computed: {
| rConfig() {
| let rConfig = this.referConfig;
| if (!rConfig.options) {
| rConfig.options = {};
| }
| rConfig.options.isMuti = rConfig.options.muti || rConfig.options.isMuti || false;
| rConfig.options.url='/org/userQueryController/referGrid';
| rConfig.options.width=this.referConfig.options.width || '80%';
| rConfig.options.tableConfig={
| cols:[{
| prop: 'code',
| label: '用户名',
| sortable: true,
| width: 150,
| search: true
| },{
| prop: 'name',
| label: '姓名',
| sortable: true,
| width: 150,
| search: true
| }, {
| prop: 'deptIdName',
| label: '所属部门',
| width: 260,
| }, {
| prop: 'sexText',
| label: '性别',
| width: 80
| }]
| };
| rConfig.options.classifys=[{
| title:'部门',
| treeUrl:'/org/deptController/referGrid', //分类的路径
| queryByClassifyUrl:'/permission/userQueryController/listUserByDeptId', //'列表'
| queryField:'deptId', //列表数据中分类的字段
| classifyValueField:'id', //从树上获取的字段
| },{
| title:'角色',
| treeUrl:'/permission/roleController/referGrid', //分类的路径
| queryByClassifyUrl:'/permission/userQueryController/listUserByRoleId', //'列表'
| queryField:'roleId', //列表数据中分类的字段
| classifyValueField:'id', //从树上获取的字段
| }];
| rConfig.options.onlyTable=false;
| return rConfig;
| },
| titleD(){
| let title = this.referConfig.title || "";
| title = title.replace(":", "");
| title = title
| ? "为【" + title + "】选取值"
| : "为【" + this.referConfig.showProp + "】选取值";
| return title;
| },
| textD(){
| return verifyNull(this.text) ? (this.referConfig.options.defalutText || '') : this.text;
| },
| valueD(){
| return verifyNull(this.value) ? (this.referConfig.options.defalutValue || '') :this.value;
| }
| },
| created() {
| },
| methods: {
| setValue(value) {
| this.emitData = value;
| }
| },
| watch: {
| // 修改反馈到父组件
| emitData: {
| deep: true,
| handler(newV) {
| this.$emit("setReferValue", newV);
| }
| }
| }
| };
| </script>
|
| <style scoped>
|
| </style>
|
|