按需加载代码部分修改,聊天头像太大改成按需加载、行编辑的组件引入导致全局注册整个form
parent
50c1f2362f
commit
7d05d7f6fd
|
@ -30,7 +30,8 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { JSelectDept } from '/@/components/Form';
|
||||
//import { JSelectDept } from '/@/components/Form';
|
||||
import JSelectDept from '/src/components/form/src/jeecg/components/JSelectDept.vue';
|
||||
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
</template>
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref } from 'vue';
|
||||
import { JPopup } from '/@/components/Form';
|
||||
//import { JPopup } from '/@/components/Form';
|
||||
import JPopup from '/src/components/form/src/jeecg/components/JPopup.vue';
|
||||
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
|
||||
import { dispatchEvent, vModel } from '/@/components/jeecg/JVxeTable/utils';
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { JSelectUser } from '/@/components/Form';
|
||||
//import { JSelectUser } from '/@/components/Form';
|
||||
import JSelectUser from '/src/components/form/src/jeecg/components/JSelectUser.vue';
|
||||
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
|
||||
import { dispatchEvent } from '/@/components/jeecg/JVxeTable/utils';
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
import { Comment, Tooltip } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import MyComment from './MyComment.vue';
|
||||
import { list, saveOne, deleteOne, useCommentWithFile, useEmojiHtml, queryById } from './useComment';
|
||||
import { list, saveOne, deleteOne, useCommentWithFile, useEmojiHtml, queryById, getGloablEmojiIndex } from './useComment';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import HistoryFileList from './HistoryFileList.vue';
|
||||
import { Popconfirm } from 'ant-design-vue';
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
import { useModal } from '/@/components/Modal';
|
||||
import UploadChunk from './UploadChunk.vue';
|
||||
import 'emoji-mart-vue-fast/css/emoji-mart.css';
|
||||
import { useEmojiHtml } from './useComment';
|
||||
import { getGloablEmojiIndex, useEmojiHtml } from './useComment';
|
||||
|
||||
const optionsName = {
|
||||
categories: {
|
||||
|
|
|
@ -13,6 +13,8 @@ import txt from '/@/assets/svg/fileType/txt.svg';
|
|||
import word from '/@/assets/svg/fileType/word.svg';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { createImgPreview } from '/@/components/Preview';
|
||||
import data from "emoji-mart-vue-fast/data/apple.json";
|
||||
import { EmojiIndex } from "emoji-mart-vue-fast/src";
|
||||
|
||||
enum Api {
|
||||
list = '/sys/comment/listByForm',
|
||||
|
@ -38,6 +40,21 @@ const getViewFileDomain = () => defHttp.get({ url: Api.getFileViewDomain });
|
|||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export function getGloablEmojiIndex(){
|
||||
if(window['myEmojiIndex']){
|
||||
console.log("----走window['myEmojiIndex']缓存,不new新对象!")
|
||||
return window['myEmojiIndex'];
|
||||
}
|
||||
|
||||
window['myEmojiIndex'] = new EmojiIndex(data, {
|
||||
function() {
|
||||
return true;
|
||||
},
|
||||
exclude:['recent','people','nature','foods','activity','places','objects','symbols','flags']
|
||||
});
|
||||
return window['myEmojiIndex'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单条记录
|
||||
* @param params
|
||||
|
|
|
@ -2,10 +2,10 @@ import type { App } from 'vue';
|
|||
import { registerJVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||
import { registerJVxeCustom } from '/@/components/JVxeCustom';
|
||||
|
||||
// 注册全局聊天表情包
|
||||
import { Picker } from 'emoji-mart-vue-fast/src';
|
||||
import { EmojiIndex } from "emoji-mart-vue-fast/src";
|
||||
import data from "emoji-mart-vue-fast/data/apple.json";
|
||||
// // 注册全局聊天表情包
|
||||
// import { Picker } from 'emoji-mart-vue-fast/src';
|
||||
// import { EmojiIndex } from "emoji-mart-vue-fast/src";
|
||||
// import data from "emoji-mart-vue-fast/data/apple.json";
|
||||
|
||||
// 注册全局dayjs
|
||||
import dayjs from 'dayjs';
|
||||
|
@ -17,23 +17,23 @@ export async function registerThirdComp(app: App) {
|
|||
registerJVxeTable(app);
|
||||
// 注册 JVxeTable 自定义组件
|
||||
await registerJVxeCustom();
|
||||
//---------------------------------------------------------------------
|
||||
// 注册全局聊天表情包
|
||||
app.component('Picker', Picker);
|
||||
let myEmojiIndex = new EmojiIndex(data, {
|
||||
function() {
|
||||
return true;
|
||||
},
|
||||
exclude:['recent','people','nature','foods','activity','places','objects','symbols','flags']
|
||||
});
|
||||
app.config.globalProperties.$globalEmojiIndex = myEmojiIndex
|
||||
app.provide('$globalEmojiIndex', myEmojiIndex)
|
||||
//---------------------------------------------------------------------
|
||||
// //---------------------------------------------------------------------
|
||||
// // 注册全局聊天表情包
|
||||
// app.component('Picker', Picker);
|
||||
// let myEmojiIndex = new EmojiIndex(data, {
|
||||
// function() {
|
||||
// return true;
|
||||
// },
|
||||
// exclude:['recent','people','nature','foods','activity','places','objects','symbols','flags']
|
||||
// });
|
||||
// app.config.globalProperties.$globalEmojiIndex = myEmojiIndex;
|
||||
// app.provide('$globalEmojiIndex', myEmojiIndex);
|
||||
// //---------------------------------------------------------------------
|
||||
// 注册全局dayjs
|
||||
dayjs.locale('zh-cn');
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(customParseFormat);
|
||||
app.config.globalProperties.$dayjs = dayjs
|
||||
app.provide('$dayjs', dayjs)
|
||||
app.config.globalProperties.$dayjs = dayjs;
|
||||
app.provide('$dayjs', dayjs);
|
||||
//---------------------------------------------------------------------
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue