1.修改通知消息bug
2.修改富文本编辑器组件
This commit is contained in:
2026-02-11 16:42:30 +08:00
parent a416e9d7df
commit e897357108
7 changed files with 105 additions and 21 deletions
@@ -1,5 +1,5 @@
<template>
<Tinymce v-bind="bindProps" @change="onChange" />
<Tinymce v-bind="bindProps" @change="onChange" @uploadingStatus="changeStatus" />
</template>
<script lang="ts">
@@ -18,7 +18,7 @@
disabled: propTypes.bool.def(false),
resize: propTypes.bool.def(true),
},
emits: ['change', 'update:value'],
emits: ['change', 'update:value', 'status', 'update:status'],
setup(props, { emit, attrs }) {
// 合并 props 和 attrs
const bindProps = computed(() => Object.assign({}, props, attrs));
@@ -29,9 +29,15 @@
emit('update:value', value);
}
function changeStatus(flag: boolean) {
emit('status', flag);
emit('update:status', flag);
}
return {
bindProps,
onChange,
changeStatus,
};
},
});
@@ -126,8 +126,9 @@
watch(
() => props.apiParams,
() => {
if (props.apiParams) {
(n: any, o: any) => {
if (n && JSON.stringify(n) !== JSON.stringify(o)) {
console.log('111');
getTreeData1();
}
}
+3 -1
View File
@@ -123,7 +123,7 @@
components: { ImgUpload },
inheritAttrs: false,
props: tinymceProps,
emits: ['change', 'update:modelValue', 'inited', 'init-error'],
emits: ['change', 'update:modelValue', 'inited', 'init-error', 'uploadingStatus'],
setup(props, { emit, attrs }) {
const editorRef = ref<Nullable<Editor>>(null);
const fullscreen = ref(false);
@@ -347,6 +347,7 @@
}
editor.execCommand('mceInsertContent', false, getUploadingImgName(name));
const content = editor?.getContent() ?? '';
emit('uploadingStatus', true);
setValue(editor, content);
}
@@ -357,6 +358,7 @@
}
const content = editor?.getContent() ?? '';
const val = content?.replace(getUploadingImgName(name), `<img src="${url}"/>`) ?? '';
emit('uploadingStatus', false);
setValue(editor, val);
}
@@ -9,11 +9,12 @@
<div style="border-bottom: 1px dashed; margin-bottom: 10px; padding: 0 0 10px; font-weight: 500; display: flex">
<div>通知范围</div>
<div style="flex: 1">
{{
{{ dataInfo?.scopeType === 1 ? '指定机构' : '指定员工' }}
({{
dataInfo?.scopeType === 1
? dataInfo?.departScopeList && dataInfo?.departScopeList[0]?.record
: dataInfo?.userScopeList && dataInfo?.userScopeList.map((item: any) => item.record).join(',')
}}
}})
</div>
</div>
<div class="information">
@@ -26,18 +27,21 @@
import BasicModal from '/@/components/Modal/src/BasicModal.vue';
import { useModalInner } from '/@/components/Modal';
import { ref } from 'vue';
import { preEditorValue } from '/@/utils/editor';
import { useGlobSetting } from '/@/hooks/setting';
const dataInfo = ref({
information: '',
});
const globSetting = useGlobSetting();
const [registerModal, {}] = useModalInner((data: any) => {
data.content = preEditorValue(data.content, globSetting.domainUrl);
dataInfo.value = data;
});
</script>
<style scoped lang="less">
.modal-d {
max-height: 65vh;
height: 65vh;
display: flex;
flex-direction: column;
padding-left: 6px;
@@ -14,16 +14,17 @@
<template v-if="model[field] === 1">
<div>选择机构</div>
<jlazy-tree-select
style="width: 100%"
:isHaveFLevel="true"
:multiple="false"
:fieldNamesInfo="{ key: 'resultItem', label: 'title', value: 'resultItem' }"
treeNodeFilterProp="title"
:api-params="{ primaryKey: 'orgCode', ids: userInfo.orgCode }"
v-model:value="scopeDept"
:maxTagCount="3"
/>
</template>
<template v-else>
<div>指定员工</div>
<div>选择员工</div>
<a-input v-model:value="model['userScopeListRecord']" readonly placeholder="请选择员工" @click="openPeople" />
</template>
</div>
@@ -52,6 +53,8 @@
import { addApi, scopeUserListApi } from '/@/views/system/noticeList/noticeList.api';
import { useUserStore } from '/@/store/modules/user';
import { message } from 'ant-design-vue';
import { preEditorValue } from '/@/utils/editor';
import { useGlobSetting } from '/@/hooks/setting';
const userInfo = useUserStore().getUserInfo;
@@ -61,7 +64,8 @@
const emit = defineEmits(['ok']);
const scopeDept = ref<any>();
const globSetting = useGlobSetting();
const scopeDept = ref<any>([]);
const expandedRowKeys = ref<any[]>([]);
const auditorTableProps = ref<object>({
tableProps: {
@@ -126,8 +130,13 @@
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
scopeDept.value = [];
expandedRowKeys.value = [];
setModalProps({ confirmLoading: false });
resetFields();
setFieldsValue({
imgStatus: '0',
});
});
function onSelectUserOk(e: any) {
@@ -150,15 +159,22 @@
async function handleSubmit() {
try {
const values = await validate();
if (!scopeDept.value && values.scopeType === 1) return message.error('请选择机构');
if (values?.imgstatus === '1') return message.error('请等待资源上传');
if (scopeDept.value.length === 0 && values.scopeType === 1) return message.error('请选择机构');
if (expandedRowKeys.value.length === 0 && values.scopeType === 2) return message.error('请指定员工');
values.content = preEditorValue(values.content, globSetting.domainUrl);
if (values.scopeType === 1) {
values['departScopeList'] = [JSON.parse(scopeDept.value)];
} else {
values['userScopeList'] = expandedRowKeys.value.map((item) => {
values['departScopeList'] = scopeDept.value.map((item: any) => {
return {
id: JSON.parse(item).userId,
scopeId: JSON.parse(item).scopeId,
record: JSON.parse(item).record,
};
});
} else {
values['userScopeList'] = expandedRowKeys.value.map((item: any) => {
return {
scopeId: JSON.parse(item).userId,
record: JSON.parse(item).realName,
};
});
@@ -180,10 +196,14 @@
display: flex;
align-items: center;
margin: 10px 0 -5px;
width: 100%;
> div {
&:nth-child(1) {
width: 80px;
}
&:nth-child(2) {
flex: 1;
}
}
}
</style>
+14 -2
View File
@@ -11,11 +11,11 @@ export const columns: BasicColumn[] = [
customRender: ({ text }) => {
switch (text) {
case 1:
return '指定部门';
return '指定机构';
case 2:
return '指定员工';
case 3:
return '即指定部门又指定员工';
return '即指定机构又指定员工';
default:
return '-';
}
@@ -116,8 +116,20 @@ export const schemas: FormSchema[] = [
label: '通知内容',
field: 'content',
component: 'JEditor',
componentProps: ({ formModel }) => ({
showImageUpload: true,
'onUpdate:status': (v: any) => {
formModel.imgStatus = v ? '1' : '0';
},
}),
required: true,
},
{
label: '',
field: 'imgStatus',
component: 'Input',
show: false,
},
{
label: '',
field: 'id',
+41 -2
View File
@@ -5,12 +5,26 @@
<div style="font-size: 16px; font-weight: bold"> 公告通知列表 </div>
<div class="button-d">
<a-button type="primary" @click="() => openModal(true, {})">新增</a-button>
<a-button type="primary">导出</a-button>
<a-button type="primary">导出记录</a-button>
<!-- <a-button type="primary">导出</a-button>-->
<!-- <a-button type="primary">导出记录</a-button>-->
<a-button type="danger" @click="deleteBatch">批量删除</a-button>
</div>
</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'scopeType'">
<a-tooltip placement="topLeft">
<template #title>
<span>
<template v-if="record?.scopeType == 1"> 指定机构({{ record?.depart }}) </template>
<template v-if="record?.scopeType == 2"> 指定员工({{ record?.user }}) </template>
</span>
</template>
<div class="no-text-to-long" v-if="record?.scopeType == 1"> 指定机构({{ record?.depart }}) </div>
<div class="no-text-to-long" v-if="record?.scopeType == 2"> 指定员工({{ record?.user }}) </div>
</a-tooltip>
</template>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
@@ -49,6 +63,25 @@
width: 120,
fixed: 'right',
},
afterFetch: (data: any) => {
return data.map((item: any) => {
item['depart'] = (
item?.departScopeList
? item?.departScopeList.map((t: any) => {
return t?.record;
})
: []
).join('、');
item['user'] = (
item?.userScopeList
? item?.userScopeList.map((t: any) => {
return t?.record;
})
: []
).join('、');
return item;
});
},
},
});
@@ -90,4 +123,10 @@
margin: 5px 10px 0 0;
}
}
.no-text-to-long {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>