管理员新增渠道channel_id和代理angent_id
This commit is contained in:
@@ -41,6 +41,19 @@
|
||||
prop="nickname"
|
||||
:placeholder="t('Please input field', { field: t('auth.admin.nickname') })"
|
||||
/>
|
||||
<FormItem
|
||||
v-if="baTable.form.operate === 'Add' && adminInfo.super"
|
||||
:label="t('auth.admin.channel_id')"
|
||||
v-model="baTable.form.items!.channel_id"
|
||||
prop="channel_id"
|
||||
type="remoteSelect"
|
||||
:input-attr="{
|
||||
pk: 'id',
|
||||
field: 'name',
|
||||
remoteUrl: '/admin/channel.Manage/index',
|
||||
placeholder: t('auth.admin.Please select channel'),
|
||||
}"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('auth.admin.group')"
|
||||
v-model="baTable.form.items!.group_arr"
|
||||
@@ -134,6 +147,17 @@ const { t } = useI18n()
|
||||
const rules: Partial<Record<string, FormItemRule[]>> = reactive({
|
||||
username: [buildValidatorData({ name: 'required', title: t('auth.admin.username') }), buildValidatorData({ name: 'account' })],
|
||||
nickname: [buildValidatorData({ name: 'required', title: t('auth.admin.nickname') })],
|
||||
channel_id: [
|
||||
{
|
||||
validator: (_rule: any, val: any, callback: Function) => {
|
||||
if (baTable.form.operate === 'Add' && adminInfo.super && !val) {
|
||||
return callback(new Error(t('auth.admin.Please select channel')))
|
||||
}
|
||||
return callback()
|
||||
},
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
group_arr: [buildValidatorData({ name: 'required', message: t('Please select field', { field: t('auth.admin.group') }) })],
|
||||
email: [buildValidatorData({ name: 'email', message: t('Please enter the correct field', { field: t('auth.admin.email') }) })],
|
||||
mobile: [buildValidatorData({ name: 'mobile', message: t('Please enter the correct field', { field: t('auth.admin.mobile') }) })],
|
||||
|
||||
Reference in New Issue
Block a user