|
@@ -9,14 +9,16 @@
|
9
|
9
|
<div class="form-wrap" v-loading="loading">
|
10
|
10
|
<div class="form-item">
|
11
|
11
|
<span class="lable required">所属类型</span>
|
12
|
|
- <el-select v-model="form.type" size="small" placeholder="请选择成员所属类型">
|
|
12
|
+ <span>ADQ</span><!-- 写死为ADQ -->
|
|
13
|
+ <!-- <el-select v-model="form.type" size="small" placeholder="请选择成员所属类型">
|
13
|
14
|
<el-option v-for="t in typeOptions" :key="t.value" :label="t.label" :value="t.value" />
|
14
|
|
- </el-select>
|
|
15
|
+ </el-select> -->
|
15
|
16
|
</div>
|
16
|
17
|
<div class="form-item">
|
17
|
|
- <span class="lable required">数据源ID</span>
|
18
|
|
- <el-input v-model="form.sourceId" size="small" placeholder="请输入数据源ID" />
|
|
18
|
+ <span class="lable">数据源ID</span>
|
|
19
|
+ <el-input v-model="form.user_action_set_id" size="small" placeholder="请输入数据源ID" clearable />
|
19
|
20
|
</div>
|
|
21
|
+ <div class="form-tips">可传空,此时会将原来设置的数据源置空</div>
|
20
|
22
|
</div>
|
21
|
23
|
<div slot="footer" class="dialog-footer">
|
22
|
24
|
<el-button size="mini" @click="handleCancel">取 消</el-button>
|
|
@@ -39,21 +41,29 @@ export default {
|
39
|
41
|
type: Boolean,
|
40
|
42
|
default: () => false
|
41
|
43
|
},
|
|
44
|
+ // 成员信息
|
|
45
|
+ userInfo: {
|
|
46
|
+ type: Object,
|
|
47
|
+ default: () => ({
|
|
48
|
+ user_action_set_id: '',
|
|
49
|
+ user_id: '',
|
|
50
|
+ })
|
|
51
|
+ },
|
42
|
52
|
},
|
43
|
53
|
data() {
|
44
|
54
|
return {
|
45
|
55
|
loading: false,
|
46
|
56
|
typeOptions: Object.freeze(typeOptions),
|
47
|
57
|
form: {
|
48
|
|
- type: '',
|
49
|
|
- sourceId: '',
|
|
58
|
+ user_action_set_id: '',
|
|
59
|
+ user_id: '',
|
50
|
60
|
}
|
51
|
61
|
}
|
52
|
62
|
},
|
53
|
63
|
watch: {
|
54
|
|
- // 弹框展示时初始化数据
|
|
64
|
+ // 弹框展示时获取表单数据
|
55
|
65
|
dialogVisible(isShow) {
|
56
|
|
- isShow && this.handleInit()
|
|
66
|
+ isShow && this.handleGetFormData()
|
57
|
67
|
},
|
58
|
68
|
},
|
59
|
69
|
methods: {
|
|
@@ -61,11 +71,12 @@ export default {
|
61
|
71
|
try {
|
62
|
72
|
// 表单校验
|
63
|
73
|
await this.handleFormValidate()
|
64
|
|
- this.loading = true
|
65
|
74
|
const params = { ...this.form }
|
66
|
|
- const { data: res } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.xxx}`, params)
|
|
75
|
+ this.loading = true
|
|
76
|
+ const { data: res = {} } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.bindUserActionSetId}`, params)
|
67
|
77
|
if (res && res.errno == 0) {
|
68
|
78
|
this.$message.success('操作成功')
|
|
79
|
+ this.handleClearFormData()
|
69
|
80
|
this.$emit('confirm')
|
70
|
81
|
} else if (res.errno != 4002) {
|
71
|
82
|
this.$message.warning(res.err || '操作失败')
|
|
@@ -77,26 +88,33 @@ export default {
|
77
|
88
|
}
|
78
|
89
|
},
|
79
|
90
|
handleCancel() {
|
|
91
|
+ this.handleClearFormData()
|
80
|
92
|
this.$emit('cancel')
|
81
|
93
|
},
|
82
|
94
|
// 执行表单校验
|
83
|
95
|
handleFormValidate() {
|
84
|
96
|
return new Promise((resolve, reject) => {
|
85
|
|
- if (!this.form.type) {
|
86
|
|
- this.$message.warning('请选择成员所属类型')
|
87
|
|
- reject('表单校验未通过')
|
88
|
|
- } else if (!this.form.sourceId) {
|
89
|
|
- this.$message.warning('请输入数据源ID')
|
90
|
|
- reject('表单校验未通过')
|
91
|
|
- } else {
|
92
|
|
- resolve('表单校验通过')
|
93
|
|
- }
|
|
97
|
+ // if (!this.form.user_action_set_id) {
|
|
98
|
+ // this.$message.warning('请输入数据源ID')
|
|
99
|
+ // reject('表单校验未通过')
|
|
100
|
+ // } else {
|
|
101
|
+ // resolve('表单校验通过')
|
|
102
|
+ // }
|
|
103
|
+
|
|
104
|
+ // 此版本无必填项
|
|
105
|
+ resolve('表单校验通过')
|
94
|
106
|
})
|
95
|
107
|
},
|
96
|
|
- // 初始化弹框表单数据
|
97
|
|
- handleInit() {
|
98
|
|
- this.form.type = ''
|
99
|
|
- this.form.sourceId = ''
|
|
108
|
+ // 获取弹框表单数据
|
|
109
|
+ handleGetFormData() {
|
|
110
|
+ const { user_action_set_id = '', user_id = '' } = this.userInfo
|
|
111
|
+ this.form.user_action_set_id = user_action_set_id
|
|
112
|
+ this.form.user_id = user_id
|
|
113
|
+ },
|
|
114
|
+ // 清空弹框表单数据
|
|
115
|
+ handleClearFormData() {
|
|
116
|
+ this.form.user_action_set_id = ''
|
|
117
|
+ this.form.user_id = ''
|
100
|
118
|
},
|
101
|
119
|
},
|
102
|
120
|
};
|
|
@@ -105,6 +123,7 @@ export default {
|
105
|
123
|
<style lang="scss" scoped>
|
106
|
124
|
.bind-dialog {
|
107
|
125
|
.form-wrap {
|
|
126
|
+ padding: 0 10px;
|
108
|
127
|
.form-item {
|
109
|
128
|
display: flex;
|
110
|
129
|
align-items: center;
|
|
@@ -117,16 +136,26 @@ export default {
|
117
|
136
|
font-weight: 500;
|
118
|
137
|
flex-shrink: 0;
|
119
|
138
|
|
120
|
|
- &.required::before {
|
121
|
|
- content: "*";
|
122
|
|
- color: #f56c6c;
|
123
|
|
- margin-right: 4px;
|
|
139
|
+ &.required {
|
|
140
|
+ position: relative;
|
|
141
|
+ &::before {
|
|
142
|
+ position: absolute;
|
|
143
|
+ left: -8px;
|
|
144
|
+ top: 0;
|
|
145
|
+ content: "*";
|
|
146
|
+ color: #f56c6c;
|
|
147
|
+ }
|
124
|
148
|
}
|
125
|
149
|
}
|
126
|
150
|
.el-select {
|
127
|
151
|
width: 100%;
|
128
|
152
|
}
|
129
|
153
|
}
|
|
154
|
+ .form-tips {
|
|
155
|
+ margin: 5px 0 0 80px;
|
|
156
|
+ font-size: 13px;
|
|
157
|
+ color: #999;
|
|
158
|
+ }
|
130
|
159
|
}
|
131
|
160
|
.dialog-footer {
|
132
|
161
|
text-align: center;
|