|
@@ -5,7 +5,7 @@
|
|
|
prop="recipientType"
|
|
prop="recipientType"
|
|
|
:rules="[{ required: true, message: '请选择推送对象' }]"
|
|
:rules="[{ required: true, message: '请选择推送对象' }]"
|
|
|
>
|
|
>
|
|
|
- <el-radio-group v-model="ruleForm.recipientType">
|
|
|
|
|
|
|
+ <el-radio-group v-model="ruleForm.recipientType" :disabled="disabled">
|
|
|
<el-radio
|
|
<el-radio
|
|
|
v-for="item in recipientTypeName"
|
|
v-for="item in recipientTypeName"
|
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -25,6 +25,7 @@
|
|
|
multiple
|
|
multiple
|
|
|
placeholder="请选择分组"
|
|
placeholder="请选择分组"
|
|
|
style="width: 300px"
|
|
style="width: 300px"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in options"
|
|
v-for="item in options"
|
|
@@ -54,6 +55,7 @@
|
|
|
placeholder="请选择人员"
|
|
placeholder="请选择人员"
|
|
|
style="width: 300px"
|
|
style="width: 300px"
|
|
|
@click="userInfo = true"
|
|
@click="userInfo = true"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
>
|
|
>
|
|
|
<el-option v-for="user in selectedUser" :key="user.id" :label="user.name" :value="user">
|
|
<el-option v-for="user in selectedUser" :key="user.id" :label="user.name" :value="user">
|
|
|
</el-option>
|
|
</el-option>
|
|
@@ -147,6 +149,21 @@ import { GroupData } from '../persongroup/type';
|
|
|
const ruleFormRef = ref<FormInstance>();
|
|
const ruleFormRef = ref<FormInstance>();
|
|
|
const groupInfo = ref<boolean>(false);
|
|
const groupInfo = ref<boolean>(false);
|
|
|
const userInfo = ref<boolean>(false);
|
|
const userInfo = ref<boolean>(false);
|
|
|
|
|
+const disabled = ref<boolean>(false);
|
|
|
|
|
+interface customUserList {
|
|
|
|
|
+ userId: number;
|
|
|
|
|
+ userLoginName: string;
|
|
|
|
|
+ userNickname: string;
|
|
|
|
|
+ userNumber: string;
|
|
|
|
|
+}
|
|
|
|
|
+interface userGroupVOList {
|
|
|
|
|
+ userGroupId: number;
|
|
|
|
|
+ total: number;
|
|
|
|
|
+ operatorName: string;
|
|
|
|
|
+ operationTime: string;
|
|
|
|
|
+ name: string;
|
|
|
|
|
+ description: string;
|
|
|
|
|
+}
|
|
|
interface UserList {
|
|
interface UserList {
|
|
|
id: string;
|
|
id: string;
|
|
|
name: string;
|
|
name: string;
|
|
@@ -164,8 +181,9 @@ const ruleForm = reactive<RuleForm>({
|
|
|
});
|
|
});
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
recipientType?: number;
|
|
recipientType?: number;
|
|
|
- userGroupList?: number[];
|
|
|
|
|
- customUserList?: UserList[];
|
|
|
|
|
|
|
+ userGroupList?: userGroupVOList[];
|
|
|
|
|
+ customUserList?: customUserList[];
|
|
|
|
|
+ disabled?: boolean;
|
|
|
}>();
|
|
}>();
|
|
|
interface Options {
|
|
interface Options {
|
|
|
userGroupId?: number;
|
|
userGroupId?: number;
|
|
@@ -203,6 +221,13 @@ const handleSubmit = (selectedData: UserList[]) => {
|
|
|
ruleForm.customUserList = selectedUser.value;
|
|
ruleForm.customUserList = selectedUser.value;
|
|
|
userInfo.value = false;
|
|
userInfo.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
+const formatCustomUserList = (customList: customUserList[]): UserList[] => {
|
|
|
|
|
+ return customList.map((item) => ({
|
|
|
|
|
+ id: `u${item.userId}`,
|
|
|
|
|
+ userId: item.userId,
|
|
|
|
|
+ name: `${item.userLoginName}-${item.userNickname}`,
|
|
|
|
|
+ }));
|
|
|
|
|
+};
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
submitForm,
|
|
submitForm,
|
|
|
getChildValue,
|
|
getChildValue,
|
|
@@ -217,11 +242,14 @@ watchEffect(() => {
|
|
|
ruleForm.recipientType = props.recipientType;
|
|
ruleForm.recipientType = props.recipientType;
|
|
|
}
|
|
}
|
|
|
if (props.userGroupList) {
|
|
if (props.userGroupList) {
|
|
|
- ruleForm.userGroupList = props.userGroupList;
|
|
|
|
|
|
|
+ ruleForm.userGroupList = props.userGroupList.map((item) => item.userGroupId);
|
|
|
}
|
|
}
|
|
|
if (props.customUserList) {
|
|
if (props.customUserList) {
|
|
|
- ruleForm.customUserList = props.customUserList;
|
|
|
|
|
- selectedUser.value = props.customUserList;
|
|
|
|
|
|
|
+ ruleForm.customUserList = formatCustomUserList(props.customUserList);
|
|
|
|
|
+ selectedUser.value = formatCustomUserList(props.customUserList);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (props.disabled) {
|
|
|
|
|
+ disabled.value = props.disabled;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
watch(
|
|
watch(
|