Browse Source

fix: patch chat msg

master
wangxiang 2 years ago
parent
commit
a2b08e5f92
  1. 4
      src/views/common/push/pushChatMessage/ChatMessageModal.vue
  2. 80
      src/views/common/push/pushChatMessage/chatMessage.data.ts
  3. 6
      src/views/common/push/pushConcern/concern.data.ts
  4. 2
      src/views/common/push/pushConcern/index.vue
  5. 18
      src/views/common/push/pushType/type.data.ts

4
src/views/common/push/pushChatMessage/ChatMessageModal.vue

@ -20,6 +20,7 @@
/** https://v3.cn.vuejs.org/api/options-data.html#emits */ /** https://v3.cn.vuejs.org/api/options-data.html#emits */
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const [registerForm, { resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({ const [registerForm, { resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({
disabled: true,
labelWidth: 100, labelWidth: 100,
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
@ -29,6 +30,9 @@
// //
await resetFields(); await resetFields();
await clearValidate(); await clearValidate();
await updateSchema([
]);
// //
tag.value = data._tag; tag.value = data._tag;
const refId = data.record?.id; const refId = data.record?.id;

80
src/views/common/push/pushChatMessage/chatMessage.data.ts

@ -94,37 +94,6 @@ export const formSchema: FormSchema[] = [
component: 'Input', component: 'Input',
show: false show: false
}, },
{
field: 'pushTypeId',
label: '推送类型',
component: 'ApiSelect',
componentProps: {
disabled: true,
api: listPushType,
params: {
size: 99
},
labelField: 'name',
valueField: 'id',
resultField: 'data'
},
},
{
field: 'status',
label: '推送状态',
component: 'Select',
colProps: {
span: 12
},
componentProps: {
disabled: true,
options: [
{ label: '待审核', value: '0' },
{ label: '未读', value: '1' },
{ label: '已读', value: '2' }
]
}
},
{ {
field: 'aliasType', field: 'aliasType',
label: '别名类型', label: '别名类型',
@ -132,9 +101,6 @@ export const formSchema: FormSchema[] = [
colProps: { colProps: {
span: 12 span: 12
}, },
componentProps: {
disabled: true
}
}, },
{ {
field: 'alias', field: 'alias',
@ -142,26 +108,23 @@ export const formSchema: FormSchema[] = [
component: 'Input', component: 'Input',
colProps: { colProps: {
span: 12 span: 12
},
componentProps: {
disabled: true
} }
}, },
{ {
field: 'title', field: 'title',
label: '通知标题', label: '通知标题',
component: 'Input', component: 'Input',
componentProps: { colProps: {
disabled: true span: 12
} }
}, },
{ {
field: 'text', field: 'text',
label: '通知内容', label: '通知内容',
component: 'Input', component: 'Input',
componentProps: { colProps: {
disabled: true span: 12
} },
}, },
{ {
field: 'playSound', field: 'playSound',
@ -169,10 +132,9 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
disabled: true,
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' },
] ]
}, },
colProps: { colProps: {
@ -185,10 +147,9 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
disabled: true,
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' },
] ]
}, },
colProps: { colProps: {
@ -201,10 +162,9 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
disabled: true,
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' },
] ]
}, },
colProps: { colProps: {
@ -217,7 +177,6 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
disabled: true,
options: [ options: [
{ label: '否', value: '0' }, { label: '否', value: '0' },
{ label: '是', value: '1' } { label: '是', value: '1' }
@ -232,34 +191,17 @@ export const formSchema: FormSchema[] = [
label: '离线铃声', label: '离线铃声',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: true,
placeholder: '格式为R.raw.[sound]', placeholder: '格式为R.raw.[sound]',
}, },
colProps: { colProps: {
span: 12 span: 12
} }
}, },
{
field: 'onlineRingtone',
label: '在线铃声',
component: 'ApiSelect',
componentProps: {
disabled: true,
api: listPushRingtone,
params: {
size: 99
},
labelField: 'name',
valueField: 'id',
resultField: 'data'
},
},
{ {
field: 'custom', field: 'custom',
label: '自定义通知传输数据', label: '自定义通知传输数据',
component: 'InputTextArea', component: 'InputTextArea',
componentProps: { componentProps: {
disabled: true,
rows: 6 rows: 6
}, },
}, },

6
src/views/common/push/pushConcern/concern.data.ts

@ -136,7 +136,7 @@ export const pushTypeColumns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playSound = record?.playSound; const playSound = record?.playSound;
const enable = ~~playSound === 0; const enable = ~~playSound === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);
@ -185,7 +185,7 @@ export const pushTypeColumns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playVibrate = record?.playVibrate; const playVibrate = record?.playVibrate;
const enable = ~~playVibrate === 0; const enable = ~~playVibrate === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);
@ -197,7 +197,7 @@ export const pushTypeColumns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playLights = record?.playLights; const playLights = record?.playLights;
const enable = ~~playLights === 0; const enable = ~~playLights === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);

2
src/views/common/push/pushConcern/index.vue

@ -38,6 +38,7 @@
{ {
label: '推送消息', label: '推送消息',
icon: 'fa6-regular:message', icon: 'fa6-regular:message',
ifShow: ![SystemUserType.ENTERPRISE_USER, userInfoStore.userType].includes(record.userType),
onClick: handleSend.bind(null, record) onClick: handleSend.bind(null, record)
}]" }]"
:dropDownActions="[ :dropDownActions="[
@ -72,6 +73,7 @@
import TypeModal from '../pushType/TypeModal.vue'; import TypeModal from '../pushType/TypeModal.vue';
import ConcernSendModal from './ConcernSendModal.vue'; import ConcernSendModal from './ConcernSendModal.vue';
import { PushConcernType, PushAuditStatus, PushConcernDynamicJoinType } from '/@/enums/pushEnum'; import { PushConcernType, PushAuditStatus, PushConcernDynamicJoinType } from '/@/enums/pushEnum';
import { SystemUserType } from '/@/enums/permissionEnum';
const userStore = useUserStore(); const userStore = useUserStore();
const userInfoStore = userStore.getUserInfo; const userInfoStore = userStore.getUserInfo;

18
src/views/common/push/pushType/type.data.ts

@ -55,7 +55,7 @@ export const columns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playSound = record?.playSound; const playSound = record?.playSound;
const enable = ~~playSound === 0; const enable = ~~playSound === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);
@ -67,7 +67,7 @@ export const columns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playVibrate = record?.playVibrate; const playVibrate = record?.playVibrate;
const enable = ~~playVibrate === 0; const enable = ~~playVibrate === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);
@ -79,7 +79,7 @@ export const columns = (refreshPushType: Function) => [
width: 80, width: 80,
customRender: ({ record }) => { customRender: ({ record }) => {
const playLights = record?.playLights; const playLights = record?.playLights;
const enable = ~~playLights === 0; const enable = ~~playLights === 1;
const color = enable ? 'green' : 'red'; const color = enable ? 'green' : 'red';
const text = enable ? '是' : '否'; const text = enable ? '是' : '否';
return h(Tag, { color: color }, () => text); return h(Tag, { color: color }, () => text);
@ -146,8 +146,8 @@ export const formSchema: FormSchema[] = [
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' }
] ]
}, },
colProps: { colProps: {
@ -162,8 +162,8 @@ export const formSchema: FormSchema[] = [
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' }
] ]
}, },
colProps: { colProps: {
@ -178,8 +178,8 @@ export const formSchema: FormSchema[] = [
defaultValue: '0', defaultValue: '0',
componentProps: { componentProps: {
options: [ options: [
{ label: '', value: '0' }, { label: '', value: '0' },
{ label: '', value: '1' } { label: '', value: '1' }
] ]
}, },
colProps: { colProps: {

Loading…
Cancel
Save