cnhis-design-vue 3.2.9-beta.22 → 3.2.9-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/form-render/src/components/renderer/select.d.ts +2 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +1 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
# 安装
|
2
|
-
|
3
|
-
```shell
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
5
|
-
# or
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
-
```
|
8
|
-
|
9
|
-
## 1.全局引入
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
// main.ts
|
13
|
-
import { createApp } from 'vue';
|
14
|
-
import App from './App.vue';
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
-
import cui from 'cnhis-design-vue';
|
17
|
-
|
18
|
-
const app = createApp(App);
|
19
|
-
app.use(cui).mount('#app');
|
20
|
-
```
|
21
|
-
|
22
|
-
## 2. 按需引入
|
23
|
-
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
-
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
-
|
28
|
-
```shell
|
29
|
-
# 安装自动导入样式的插件
|
30
|
-
npm i -d vite-plugin-style-import
|
31
|
-
```
|
32
|
-
|
33
|
-
```typescript
|
34
|
-
// vite.config.ts
|
35
|
-
import { defineConfig } from 'vite';
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
-
|
38
|
-
export default defineConfig({
|
39
|
-
plugins: [
|
40
|
-
// ...otherPlugins
|
41
|
-
createStyleImportPlugin({
|
42
|
-
libs: [
|
43
|
-
{
|
44
|
-
libraryName: 'cnhis-design-vue',
|
45
|
-
esModule: true,
|
46
|
-
ensureStyleFile: true,
|
47
|
-
resolveStyle: name => {
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
]
|
52
|
-
})
|
53
|
-
]
|
54
|
-
});
|
55
|
-
```
|
56
|
-
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
// main.ts
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
62
|
-
```
|
63
|
-
|
64
|
-
## 3.FAQ
|
65
|
-
|
66
|
-
### 3.1 项目打包后样式丢失
|
67
|
-
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
-
|
70
|
-
```typescript
|
71
|
-
// vite.config.ts
|
72
|
-
import { defineConfig } from 'vite';
|
73
|
-
|
74
|
-
export default defineConfig({
|
75
|
-
build: {
|
76
|
-
rollupOptions: {
|
77
|
-
// ..otherOptions
|
78
|
-
output: {
|
79
|
-
dir: './dist',
|
80
|
-
manualChunks: {
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
});
|
87
|
-
```
|
1
|
+
# 安装
|
2
|
+
|
3
|
+
```shell
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
5
|
+
# or
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
+
```
|
8
|
+
|
9
|
+
## 1.全局引入
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
// main.ts
|
13
|
+
import { createApp } from 'vue';
|
14
|
+
import App from './App.vue';
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
+
import cui from 'cnhis-design-vue';
|
17
|
+
|
18
|
+
const app = createApp(App);
|
19
|
+
app.use(cui).mount('#app');
|
20
|
+
```
|
21
|
+
|
22
|
+
## 2. 按需引入
|
23
|
+
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
+
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
+
|
28
|
+
```shell
|
29
|
+
# 安装自动导入样式的插件
|
30
|
+
npm i -d vite-plugin-style-import
|
31
|
+
```
|
32
|
+
|
33
|
+
```typescript
|
34
|
+
// vite.config.ts
|
35
|
+
import { defineConfig } from 'vite';
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
+
|
38
|
+
export default defineConfig({
|
39
|
+
plugins: [
|
40
|
+
// ...otherPlugins
|
41
|
+
createStyleImportPlugin({
|
42
|
+
libs: [
|
43
|
+
{
|
44
|
+
libraryName: 'cnhis-design-vue',
|
45
|
+
esModule: true,
|
46
|
+
ensureStyleFile: true,
|
47
|
+
resolveStyle: name => {
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
})
|
53
|
+
]
|
54
|
+
});
|
55
|
+
```
|
56
|
+
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
+
|
59
|
+
```typescript
|
60
|
+
// main.ts
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
62
|
+
```
|
63
|
+
|
64
|
+
## 3.FAQ
|
65
|
+
|
66
|
+
### 3.1 项目打包后样式丢失
|
67
|
+
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
+
|
70
|
+
```typescript
|
71
|
+
// vite.config.ts
|
72
|
+
import { defineConfig } from 'vite';
|
73
|
+
|
74
|
+
export default defineConfig({
|
75
|
+
build: {
|
76
|
+
rollupOptions: {
|
77
|
+
// ..otherOptions
|
78
|
+
output: {
|
79
|
+
dir: './dist',
|
80
|
+
manualChunks: {
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
```
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
@@ -113,7 +113,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
113
113
|
type: BooleanConstructor;
|
114
114
|
};
|
115
115
|
wordSplitFilter: {};
|
116
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
116
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend" | "patternChange")[], "update:value" | "postRecommend" | "patternChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
117
117
|
value: {
|
118
118
|
type: PropType<ArrayAble<string | number> | null>;
|
119
119
|
};
|
@@ -226,6 +226,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
226
226
|
}>> & {
|
227
227
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
228
228
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
229
|
+
onPatternChange?: ((...args: any[]) => any) | undefined;
|
229
230
|
}, {
|
230
231
|
options: AnyObject[];
|
231
232
|
multiple: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as o,
|
1
|
+
import{defineComponent as e,computed as o,watch as t,inject as l,useAttrs as a,ref as r,createVNode as s,mergeProps as n,toRaw as u}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{NSelect as p}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as m,isArray as d,isObject as c,omit as v,xor as y}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as h}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import"../../../../../shared/hooks/useScrollLoading.js";import{connect as b,mapProps as j}from"@formily/vue";import{useCommonInjection as S,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as C}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as F,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as w,assignClearBindVisited as A,createVisitedSetter as H}from"../../utils/schema.js";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as O}from"../../hooks/useFormField.js";import"@formily/reactive";import{useUrlConfigOptions as K,useAutographOptions as R,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const V=b(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{}},emits:["update:value","postRecommend","patternChange"],setup(e,{slots:b,emit:j}){const w=o({get:()=>e.value,async set(e){j("update:value",e),G(e)}}),{labelKey:A,valueKey:V,showKey:L,fetchData:P,searchContent:_,fullOptions:N,filterOptions:I,remoteOptions:W,loading:q}=e.urlConfig?K(e,w):R(e,w);t(_,(e=>{j("patternChange",{pattern:e,options:ue.value})}));const{modifyEvent:E,modifyAbleRef:z,getOptionsWithCreated:M}=f(e,{searchContent:_,labelKey:A,valueKey:V,valueRef:w,fullOptions:N}),{renderComplexOption:T,hasComplexOption:U}=k(e,w),{getRecommend:D,postRecommend:G,sortedOptions:J}=x(e,I,j,A,V),{field:Q,fieldKey:X}=O();l(F).setContext(X.value,(e=>({currentOption:m(function(e){const o=M(N.value);return d(e)?function(e){const t=o.reduce(((e,o)=>(e[o[V.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[V.value]===t)));var t}(e)),labelField:A.value,valueField:V.value})));const Y=async e=>(_.value=e,Promise.allSettled([P(e),D(e)])),{injectValueValidate:Z,injectValueWatchFromEmpty:$,injectValueBindKey:ee}=S();$(w,(()=>e.lazyRequest&&Y())),Z(w);const oe=ee(w),{menuProps:te,nodeProps:le}=g(),{renderTag:ae,renderLabel:re,renderSelectAll:se,titleRef:ne}=h(e,{labelKey:A,valueKey:V,valueRef:w,showKey:L,searchContent:_}),ue=o((()=>M(z.value?N.value:J.value))),ie=a(),pe=o((()=>{if(e.allowCreate||e.showCustomValue)return w.value;const o=e.multiple&&d(w.value);return N.value.find((e=>o?w.value.includes(e[V.value]):e[V.value]===w.value))?w.value:null})),me=r(!1);async function de(e){e&&await Y(),me.value=e}async function ce(e,o){await E.updateValue(e,o),W.value&&o&&i(o).forEach((e=>{if(!c(e))return;const o=e;o.created&&o.shouldSave&&W.value.push(v(u(o),["created","shouldSave"]))}))}const ve=l(B),{getSpan:ye}=C(),fe=H(Q,E.focus);function he(o){if(!e.multiple)return;const t=o?ue.value.map((e=>e[V.value])):[];y(t,e.value).length&&(w.value=t)}function be(o){let t=b;return e.multiple&&e.selectAll&&(t={action:()=>se(he),...b}),s(p,n({title:ne.value,key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:pe.value,onUpdateValue:ce,"menu-props":te,"node-props":le,labelField:A.value,valueField:V.value,options:ue.value,onSearch:Y,show:me.value,"onUpdate:show":de,onFocus:fe,onBlur:E.blur,renderLabel:re,renderTag:ae},o,ie),t)}return()=>{var e,o;if(!U.value)return be();const t=null!=(o=null==(e=Q.value.decoratorProps)?void 0:e.span)?o:6,l=ye(ve,Q.value.address);return s("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[be({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),N.value.map((e=>T({option:e,value:w.value,valueKey:V.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),j({dataSource:"options"},w,A));export{V as SELECT};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as s}from"../utils/index.js";import{useFieldNormalize as l}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),g=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,s,l,a,p,c,d,m,_,h,b,v;const y=g(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(s=null==(n=e.componentProps)?void 0:n.selectAll)?s:e.selectAll),A=x(null!=(a=null==(l=e.componentProps)?void 0:l.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(v=r(e.multi_select_value))?v:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=g(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=g(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=g(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=g(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=g(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=g(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=g(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=g(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=g(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=g(e);Array.isArray(e.properties)&&s("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=g(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"0"===e.is_show?"0":o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"0"===e.is_show?"0":o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:p(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=l();function N(o,i={column:9999}){let r=null;const s=k.call(t(o),i).reduce(((e,o,s)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=l(C(o),s),r=e[c(o)].properties={}):r?r[c(o)]=l(A(o),s):(r=null,e[c(o)]=l(A(o),s)),e}),{});return i.linebarAutoHidden&&Object.values(s).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:s,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),s;function l(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return p(t)}return o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
|
@@ -241,7 +241,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
241
241
|
submitFormData: (o: import("../../shared/types").AnyObject) => Promise<void>;
|
242
242
|
handleGroupName: () => Promise<void>;
|
243
243
|
handleAvatar: (options: import("./src/types").FileOptions) => Promise<void>;
|
244
|
-
|
244
|
+
closeChatSet: () => void;
|
245
245
|
NDrawer: any;
|
246
246
|
NDrawerContent: any;
|
247
247
|
NAvatar: any;
|
@@ -246,7 +246,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
246
246
|
submitFormData: (o: AnyObject) => Promise<void>;
|
247
247
|
handleGroupName: () => Promise<void>;
|
248
248
|
handleAvatar: (options: import("./types").FileOptions) => Promise<void>;
|
249
|
-
|
249
|
+
closeChatSet: () => void;
|
250
250
|
NDrawer: any;
|
251
251
|
NDrawerContent: any;
|
252
252
|
NAvatar: any;
|
@@ -107,7 +107,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
107
107
|
submitFormData: (o: AnyObject) => Promise<void>;
|
108
108
|
handleGroupName: () => Promise<void>;
|
109
109
|
handleAvatar: (options: import("../types").FileOptions) => Promise<void>;
|
110
|
-
|
110
|
+
closeChatSet: () => void;
|
111
111
|
NDrawer: any;
|
112
112
|
NDrawerContent: any;
|
113
113
|
NAvatar: any;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P}from"lodash-es";import q from"./PersonProfile.vue.js";import B from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},se=["data-time"],oe=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],ce=["innerHTML"],le=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var pe=e({__name:"ChatMain",setup(e){const pe=t(),{state:de,setMsgList:fe,relayMessage:ge}=b(),{setCurrentSessionItem:ve,isGroupChat:ye}=A(de),he=t(),Te=t(!1),Me=t({left:0,top:0}),ke=t(),_e=t(),xe={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ie=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function Ce({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,l(S,null,{trigger:()=>l(I,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>o&&N(o,"img")},null),default:()=>"下载"}),e.close]}async function we(){try{if(!xe.hasMore)return;xe.page++;const e=await E({sessionKey:de.currentSessionItem.sessionKey,page:xe.page,lastSendTime:xe.lastSendTime});if(!Array.isArray(e)||0===e.length)return xe.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=O(e).id;xe.lastSendTime=P(e).sendTime,fe(xe.page>1?[...de.msgList,...e]:e),1===xe.page&&de.currentSessionItem.unreadNum&&(await L({chatType:de.currentSessionItem.chatType,messageIdSet:[t],receiver:de.userInfo.id,sender:de.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Se(e,t){ke.value=t,async function(e){var t,n,s,o,i,r;Te.value=!0,await T();const{clientX:a,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=pe.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=he.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(r=null==(i=pe.value)?void 0:i.scrollTop)?r:0,g=5,v={};a<=m+l/2?v.left=a-m+g+"px":v.right=m+l-a-g+"px";c-p<d/2?v.top=f+g+"px":p+u-c<=d/2?v.bottom=Math.abs(f)+g+"px":v.top=f+c-p-d/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===de.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[z.TEXT,z.EMOJI].includes(t)}function Le(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===z.BLEND){const e=n.match(/<img[^>]*>/gi);return!e||!e.length}return t&&[z.TEXT,z.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,s=n.match(/<img[^>]*>/gi);return t===z.BLEND&&s&&s.length}function Ae(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function ze(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function He(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=de.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function De(e){de.currentReferenceMsg=e,de.currentReferenceMsg.content.referenceContent=null,Object.assign(de.currentReferenceMsg,{chatType:de.currentSessionItem.chatType,receiver:de.currentSessionItem.receiver,receiverAvatar:de.currentSessionItem.avatar,receiverName:de.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=_e.value)||n.click()):De(t)}function Ne(e,t){const n=de.msgList.find((e=>e.id===ke.value));ge({checkedIds:e,remark:t,content:n.content})}return Q(pe,(()=>{we()}),"top",(()=>{Te.value=!1})),s((()=>de.id),(e=>{e&&(de.currentReferenceMsg=null,Object.assign(xe,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),we())}),{immediate:!0}),s((()=>de.isAppendMsg),(e=>{e&&(fe([de.currentMsg,...de.msgList]),async function(){var e,t,n;await T();const s=null!=(t=null==(e=pe.value)?void 0:e.scrollHeight)?t:0;null==(n=pe.value)||n.scrollTo({top:s,behavior:"auto"})}(),de.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>(o(),i("div",{class:r(["chat-main",{"home-bg":!a(de).id}]),ref_key:"chatMainRef",ref:pe,style:c(a(Ie))},[l(a(M),{"show-toolbar-tooltip":"","render-toolbar":Ce},{default:u((()=>[(o(!0),i(m,null,p(a(de).msgList,((e,t)=>(o(),i(m,{key:e.id},[je(e)?(o(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(de).userInfo.id}])},[He(e,t)?(o(),i("p",V,d(e.__sendTime),1)):f("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(o(),i(m,{key:1},[Ae(e,"system")?(o(),g(B,{key:0,data:e},null,8,["data"])):f("v-if",!0),"WITHDRAWN"===e.status?(o(),i("p",Z,[v("span",null,d(e.sender==a(de).userInfo.id?"你":e.senderName)+"撤回了一条消息",1),Ee(e)?(o(),g(a(k),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){de.currentReEditMsg=e}(e)},{default:u((()=>[y(" 重新编辑 ")])),_:2},1032,["onClick"])):f("v-if",!0)])):f("v-if",!0)],64)):(o(),i("div",ee,[l(q,{"user-id":e.sender,placement:e.sender==a(de).userInfo.id?"left":"right"},{trigger:u((()=>[l(a(_),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},d(a(ye)?e.senderName:""),9,se)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(z).EMOJI,template:e.content.chatMessageType===a(z).TEMPLATE,"template--3":ze(e.content),"audio-video":a(H)(e.content),file:e.content.chatMessageType===a(z).FILE}]),onContextmenu:h((t=>Se(t,e.id)),["prevent"])},[Le(e)?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",ie,[v("span",null,d(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):f("v-if",!0),e.content.chatMessageType===a(z).EMOJI?(o(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(o(),i("pre",{key:2,innerHTML:e.__content},null,8,ce))],64)):f("v-if",!0),be(e)?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,le)):f("v-if",!0),Ae(e,"template")?(o(),g(B,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===a(z).IMAGE?(o(),g(a(x),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),a(H)(e.content)?(o(),i(m,{key:4},[l(a(I),{class:r({"is-audio":e.content.chatMessageType===a(z).AUDIO}),component:e.content.chatMessageType===a(z).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,d(a(R)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===a(z).FILE?(o(),g(a(C),{key:5,"wrap-item":!1},{default:u((()=>[l(a(I),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),l(a(C),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,d(e.__content),1),v("span",me,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(a(w),{class:"quick-menu"},{default:u((()=>[a(H)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\
|
1
|
+
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P}from"lodash-es";import q from"./PersonProfile.vue.js";import B from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},se=["data-time"],oe=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],ce=["innerHTML"],le=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var pe=e({__name:"ChatMain",setup(e){const pe=t(),{state:de,setMsgList:fe,relayMessage:ge}=b(),{setCurrentSessionItem:ve,isGroupChat:ye}=A(de),he=t(),Te=t(!1),Me=t({left:0,top:0}),ke=t(),_e=t(),xe={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ie=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function Ce({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,l(S,null,{trigger:()=>l(I,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>o&&N(o,"img")},null),default:()=>"下载"}),e.close]}async function we(){try{if(!xe.hasMore)return;xe.page++;const e=await E({sessionKey:de.currentSessionItem.sessionKey,page:xe.page,lastSendTime:xe.lastSendTime});if(!Array.isArray(e)||0===e.length)return xe.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=O(e).id;xe.lastSendTime=P(e).sendTime,fe(xe.page>1?[...de.msgList,...e]:e),1===xe.page&&de.currentSessionItem.unreadNum&&(await L({chatType:de.currentSessionItem.chatType,messageIdSet:[t],receiver:de.userInfo.id,sender:de.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Se(e,t){ke.value=t,async function(e){var t,n,s,o,i,r;Te.value=!0,await T();const{clientX:a,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=pe.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=he.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(r=null==(i=pe.value)?void 0:i.scrollTop)?r:0,g=5,v={};a<=m+l/2?v.left=a-m+g+"px":v.right=m+l-a-g+"px";c-p<d/2?v.top=f+g+"px":p+u-c<=d/2?v.bottom=Math.abs(f)+g+"px":v.top=f+c-p-d/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===de.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[z.TEXT,z.EMOJI].includes(t)}function Le(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===z.BLEND){const e=n.match(/<img[^>]*>/gi);return!e||!e.length}return t&&[z.TEXT,z.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,s=n.match(/<img[^>]*>/gi);return t===z.BLEND&&s&&s.length}function Ae(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function ze(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function He(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=de.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function De(e){de.currentReferenceMsg=e,de.currentReferenceMsg.content.referenceContent=null,Object.assign(de.currentReferenceMsg,{chatType:de.currentSessionItem.chatType,receiver:de.currentSessionItem.receiver,receiverAvatar:de.currentSessionItem.avatar,receiverName:de.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=_e.value)||n.click()):De(t)}function Ne(e,t){const n=de.msgList.find((e=>e.id===ke.value));ge({checkedIds:e,remark:t,content:n.content})}return Q(pe,(()=>{we()}),"top",(()=>{Te.value=!1})),s((()=>de.id),(e=>{e&&(de.currentReferenceMsg=null,Object.assign(xe,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),we())}),{immediate:!0}),s((()=>de.isAppendMsg),(e=>{e&&(fe([de.currentMsg,...de.msgList]),async function(){var e,t,n;await T();const s=null!=(t=null==(e=pe.value)?void 0:e.scrollHeight)?t:0;null==(n=pe.value)||n.scrollTo({top:s,behavior:"auto"})}(),de.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>(o(),i("div",{class:r(["chat-main",{"home-bg":!a(de).id}]),ref_key:"chatMainRef",ref:pe,style:c(a(Ie))},[l(a(M),{"show-toolbar-tooltip":"","render-toolbar":Ce},{default:u((()=>[(o(!0),i(m,null,p(a(de).msgList,((e,t)=>(o(),i(m,{key:e.id},[je(e)?(o(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(de).userInfo.id}])},[He(e,t)?(o(),i("p",V,d(e.__sendTime),1)):f("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(o(),i(m,{key:1},[Ae(e,"system")?(o(),g(B,{key:0,data:e},null,8,["data"])):f("v-if",!0),"WITHDRAWN"===e.status?(o(),i("p",Z,[v("span",null,d(e.sender==a(de).userInfo.id?"你":e.senderName)+"撤回了一条消息",1),Ee(e)?(o(),g(a(k),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){de.currentReEditMsg=e}(e)},{default:u((()=>[y(" 重新编辑 ")])),_:2},1032,["onClick"])):f("v-if",!0)])):f("v-if",!0)],64)):(o(),i("div",ee,[l(q,{"user-id":e.sender,placement:e.sender==a(de).userInfo.id?"left":"right"},{trigger:u((()=>[l(a(_),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},d(a(ye)?e.senderName:""),9,se)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(z).EMOJI,template:e.content.chatMessageType===a(z).TEMPLATE,"template--3":ze(e.content),"audio-video":a(H)(e.content),file:e.content.chatMessageType===a(z).FILE}]),onContextmenu:h((t=>Se(t,e.id)),["prevent"])},[Le(e)?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",ie,[v("span",null,d(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):f("v-if",!0),e.content.chatMessageType===a(z).EMOJI?(o(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(o(),i("pre",{key:2,innerHTML:e.__content},null,8,ce))],64)):f("v-if",!0),be(e)?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,le)):f("v-if",!0),Ae(e,"template")?(o(),g(B,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===a(z).IMAGE?(o(),g(a(x),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),a(H)(e.content)?(o(),i(m,{key:4},[l(a(I),{class:r({"is-audio":e.content.chatMessageType===a(z).AUDIO}),component:e.content.chatMessageType===a(z).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,d(a(R)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===a(z).FILE?(o(),g(a(C),{key:5,"wrap-item":!1},{default:u((()=>[l(a(I),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),l(a(C),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,d(e.__content),1),v("span",me,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(a(w),{class:"quick-menu"},{default:u((()=>[a(H)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),l(a(k),{quaternary:"",size:"tiny",onClick:()=>De(e)},{icon:u((()=>[l(a(I),{size:"17",component:a(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(a(k),{quaternary:"",size:"tiny",onClick:t=>Se(t,e.id)},{icon:u((()=>[l(a(I),{size:"14",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,oe)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(a(W),{ref_key:"contextmenuRef",ref:he,show:Te.value,"onUpdate:show":t[0]||(t[0]=e=>Te.value=e),position:Me.value,"msg-id":ke.value,onSelect:Re},null,8,["show","position","msg-id"]),l(U,{title:"转发消息",mode:"relay",onComfirm:Ne},{trigger:u((()=>[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:_e},"转发",512)])),_:1})],6))}});export{pe as default};
|
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
20
20
|
submitFormData: (o: AnyObject) => Promise<void>;
|
21
21
|
handleGroupName: () => Promise<void>;
|
22
22
|
handleAvatar: (options: FileOptions) => Promise<void>;
|
23
|
-
|
23
|
+
closeChatSet: () => void;
|
24
24
|
NDrawer: any;
|
25
25
|
NDrawerContent: any;
|
26
26
|
NAvatar: any;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as n,computed as s,watch as i,openBlock as o,createBlock as a,unref as r,withCtx as l,createVNode as c,createTextVNode as u,createElementBlock as m,Fragment as p,renderList as d,createElementVNode as v,toDisplayString as f,createCommentVNode as g,withKeys as _,nextTick as y}from"vue";import{NDrawer as k,NDrawerContent as h,NButton as b,NIcon as I,NAvatar as S,NUpload as w,NUploadTrigger as x,NInput as C,NSpace as U,NSwitch as z,NPopconfirm as j}from"naive-ui";import{ChevronBackOutline as G,ChevronForwardOutline as P,AddOutline as A,RemoveOutline as K,Pencil as R}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as F}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{trim as L,isFunction as B}from"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import N from"./PersonProfile.vue.js";import O from"./ChatAdd.vue.js";import{toppingSessionApi as q,groupLeaveApi as E,groupUpdateApi as H}from"../api/index.js";const J={key:0,class:"chat-set-wrapper"},M={class:"item"},Q={class:"name"},T={key:0,class:"item__right",style:{color:"var(--c-primary-color)"}},V={class:"item user-info"},W={class:"name"},X={class:"item item-column"},Y=v("span",{class:"label"},"群成员",-1),Z={class:"group-box"},$={class:"group-box__item"},ee={class:"name"},te={class:"group-box__item"},ne=v("span",{class:"name"},"添加",-1),se={class:"group-box__item"},ie=v("span",{class:"name"},"移除",-1),oe=["onClick"],ae=v("span",{class:"label"},"群头像",-1),re={class:"item"},le=v("span",{class:"label"},"群名称",-1),ce={class:"item__right"},ue={class:"txt"},me={class:"item"},pe=v("span",{class:"label"},"置顶聊天",-1),de={class:"item item--red"},ve=v("span",{class:"label"},"退出群聊",-1),fe=v("p",{style:{width:"230px"}},"是否确认退出群聊?",-1),ge={class:"item item--red"},_e=v("span",{class:"label"},"解散该群",-1),ye=v("p",{style:{width:"230px"}},"是否确认解散群聊?",-1);var ke=e({__name:"ChatSet",setup(e){const ke=t(),{state:he}=D(),{setCurrentSessionItem:be,isGroupChat:Ie}=F(he),Se=n(),we=n(!1),xe=n(""),Ce=n(!1),Ue=s((()=>{var e,t;return he.userInfo.id===(null==(t=null==(e=he.currentGroupUser)?void 0:e[0])?void 0:t.id)})),ze=s((()=>he.currentGroupUser.map((e=>e.id)))),je=s((()=>he.currentGroupUser?Ue.value?he.currentGroupUser.slice(0,6):he.currentGroupUser.slice(0,7):[]));async function Ge(e){try{await q({sessionKey:he.currentSessionItem.sessionKey,id:he.currentSessionItem.id,topping:e}),be({topping:e})}catch(e){}}async function Pe(e){await E({dissolution:!!e,groupId:he.currentSessionItem.receiver,operator:he.userInfo.id,memberIdSet:e?ze.value:[he.userInfo.id]})}async function Ae(){var e;xe.value=he.currentSessionItem.name,we.value=!0,await y(),null==(e=Se.value)||e.select()}async function Ke(e){const t=new FormData,n=Object.assign({id:he.currentSessionItem.receiver},e);for(const e in n)t.append(e,n[e]);await H(t)}async function Re(){we.value=!1;const e=L(xe.value);e&&e!==he.currentSessionItem.name&&(await Ke({name:e}),be({name:e,defaultName:e}))}async function De(e){const{file:t}=e.file,n=new FileReader;n.onload=function(e){var t;(null==(t=e.target)?void 0:t.result)&&be({avatar:e.target.result})},n.readAsDataURL(e.file.file),await Ke({file:t})}function Fe(){B(ke["onUpdate:show"])&&ke["onUpdate:show"](!1)}return i((()=>he.id),(e=>{
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as n,computed as s,watch as i,openBlock as o,createBlock as a,unref as r,withCtx as l,createVNode as c,createTextVNode as u,createElementBlock as m,Fragment as p,renderList as d,createElementVNode as v,toDisplayString as f,createCommentVNode as g,withKeys as _,nextTick as y}from"vue";import{NDrawer as k,NDrawerContent as h,NButton as b,NIcon as I,NAvatar as S,NUpload as w,NUploadTrigger as x,NInput as C,NSpace as U,NSwitch as z,NPopconfirm as j}from"naive-ui";import{ChevronBackOutline as G,ChevronForwardOutline as P,AddOutline as A,RemoveOutline as K,Pencil as R}from"@vicons/ionicons5";import{useState as D}from"../hooks/useState.js";import{useSession as F}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import{trim as L,isFunction as B}from"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import N from"./PersonProfile.vue.js";import O from"./ChatAdd.vue.js";import{toppingSessionApi as q,groupLeaveApi as E,groupUpdateApi as H}from"../api/index.js";const J={key:0,class:"chat-set-wrapper"},M={class:"item"},Q={class:"name"},T={key:0,class:"item__right",style:{color:"var(--c-primary-color)"}},V={class:"item user-info"},W={class:"name"},X={class:"item item-column"},Y=v("span",{class:"label"},"群成员",-1),Z={class:"group-box"},$={class:"group-box__item"},ee={class:"name"},te={class:"group-box__item"},ne=v("span",{class:"name"},"添加",-1),se={class:"group-box__item"},ie=v("span",{class:"name"},"移除",-1),oe=["onClick"],ae=v("span",{class:"label"},"群头像",-1),re={class:"item"},le=v("span",{class:"label"},"群名称",-1),ce={class:"item__right"},ue={class:"txt"},me={class:"item"},pe=v("span",{class:"label"},"置顶聊天",-1),de={class:"item item--red"},ve=v("span",{class:"label"},"退出群聊",-1),fe=v("p",{style:{width:"230px"}},"是否确认退出群聊?",-1),ge={class:"item item--red"},_e=v("span",{class:"label"},"解散该群",-1),ye=v("p",{style:{width:"230px"}},"是否确认解散群聊?",-1);var ke=e({__name:"ChatSet",setup(e){const ke=t(),{state:he}=D(),{setCurrentSessionItem:be,isGroupChat:Ie}=F(he),Se=n(),we=n(!1),xe=n(""),Ce=n(!1),Ue=s((()=>{var e,t;return he.userInfo.id===(null==(t=null==(e=he.currentGroupUser)?void 0:e[0])?void 0:t.id)})),ze=s((()=>he.currentGroupUser.map((e=>e.id)))),je=s((()=>he.currentGroupUser?Ue.value?he.currentGroupUser.slice(0,6):he.currentGroupUser.slice(0,7):[]));async function Ge(e){try{await q({sessionKey:he.currentSessionItem.sessionKey,id:he.currentSessionItem.id,topping:e}),be({topping:e})}catch(e){}}async function Pe(e){await E({dissolution:!!e,groupId:he.currentSessionItem.receiver,operator:he.userInfo.id,memberIdSet:e?ze.value:[he.userInfo.id]})}async function Ae(){var e;xe.value=he.currentSessionItem.name,we.value=!0,await y(),null==(e=Se.value)||e.select()}async function Ke(e){const t=new FormData,n=Object.assign({id:he.currentSessionItem.receiver},e);for(const e in n)t.append(e,n[e]);await H(t)}async function Re(){we.value=!1;const e=L(xe.value);e&&e!==he.currentSessionItem.name&&(await Ke({name:e}),be({name:e,defaultName:e}))}async function De(e){const{file:t}=e.file,n=new FileReader;n.onload=function(e){var t;(null==(t=e.target)?void 0:t.result)&&be({avatar:e.target.result})},n.readAsDataURL(e.file.file),await Ke({file:t})}function Fe(){B(ke["onUpdate:show"])&&ke["onUpdate:show"](!1)}return i((()=>he.id),(e=>{Fe()})),(e,t)=>(o(),a(r(k),{width:320,"trap-focus":!1,"block-scroll":!1,to:".iho-chat",onAfterLeave:t[7]||(t[7]=e=>Ce.value=!1)},{default:l((()=>[c(r(h),null,{header:l((()=>[r(Ie)&&Ce.value?(o(),a(r(b),{key:0,text:"",color:"#666",onClick:t[0]||(t[0]=e=>Ce.value=!1),style:{"font-size":"var(--n-title-font-size)"}},{icon:l((()=>[c(r(I),{size:20,component:r(G)},null,8,["component"])])),default:l((()=>[u(" 返回 ")])),_:1})):r(Ie)?(o(),m(p,{key:1},[u("群设置")],64)):(o(),m(p,{key:2},[u("聊天设置")],64))])),default:l((()=>[r(he).id?(o(),m("div",J,[r(Ie)&&Ce.value?(o(!0),m(p,{key:0},d(r(he).currentGroupUser,((e,t)=>(o(),a(N,{key:e.id,"user-id":e.id,placement:"left"},{trigger:l((()=>[v("div",M,[c(r(S),{round:"",size:40,src:e.avatar},null,8,["src"]),v("span",Q,f(e.name),1),0===t?(o(),m("span",T,"群主")):g("v-if",!0)])])),_:2},1032,["user-id"])))),128)):(o(),m(p,{key:1},[c(N,{"user-id":r(he).currentSessionItem.receiver,onClose:Fe,disabled:!!r(Ie),placement:"bottom-end"},{trigger:l((()=>[v("div",V,[c(r(S),{round:"",size:40,src:r(he).currentSessionItem.avatar},null,8,["src"]),v("span",W,f(r(he).currentSessionItem.name),1),r(Ie)?g("v-if",!0):(o(),a(r(I),{key:0,size:24,component:r(P),class:"item__right"},null,8,["component"]))])])),_:1},8,["user-id","disabled"]),r(Ie)?(o(),m(p,{key:0},[v("div",X,[Y,v("div",Z,[(o(!0),m(p,null,d(r(je),(e=>(o(),a(N,{key:e.id,"user-id":e.id,placement:"left-start"},{trigger:l((()=>[v("div",$,[c(r(S),{round:"",size:40,src:e.avatar},null,8,["src"]),v("span",ee,f(e.name),1)])])),_:2},1032,["user-id"])))),128)),c(O,{mode:"join",disabledIds:r(ze)},{trigger:l((()=>[v("div",te,[c(r(b),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(I),{component:r(A)},null,8,["component"])])),_:1}),ne])])),_:1},8,["disabledIds"]),r(Ue)?(o(),a(O,{key:0,title:"移除成员",mode:"remove",options:r(he).currentGroupUser},{trigger:l((()=>[v("div",se,[c(r(b),{strong:"",secondary:"",circle:""},{icon:l((()=>[c(r(I),{component:r(K)},null,8,["component"])])),_:1}),ie])])),_:1},8,["options"])):g("v-if",!0)]),c(r(b),{text:"","icon-placement":"right",color:"#999",onClick:t[1]||(t[1]=e=>Ce.value=!0)},{icon:l((()=>[c(r(I),{component:r(P)},null,8,["component"])])),default:l((()=>[u(" 查看全部群成员 ")])),_:1})]),c(r(w),{abstract:"",multiple:"",accept:"image/*",onChange:De},{default:l((()=>[c(r(x),{abstract:""},{default:l((({handleClick:e})=>[v("div",{class:"item",onClick:e},[ae,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])],8,oe)])),_:1})])),_:1}),v("div",re,[le,v("div",ce,[we.value?(o(),a(r(C),{key:0,ref_key:"inputRef",ref:Se,value:xe.value,"onUpdate:value":t[2]||(t[2]=e=>xe.value=e),onBlur:Re,onKeydown:t[3]||(t[3]=_((e=>e.target.blur()),["enter"]))},null,8,["value"])):(o(),a(r(U),{key:1,"wrap-item":!1,onClick:Ae,align:"center"},{default:l((()=>[v("span",ue,f(r(he).currentSessionItem.name),1),c(r(b),{text:"",style:{"font-size":"14px","--n-text-color":"#999"}},{default:l((()=>[c(r(I),{component:r(R)},null,8,["component"])])),_:1})])),_:1}))])])],64)):g("v-if",!0),v("div",me,[pe,c(r(z),{value:r(he).currentSessionItem.topping,"onUpdate:value":[t[4]||(t[4]=e=>r(he).currentSessionItem.topping=e),Ge],class:"item__right"},null,8,["value"])]),r(Ie)?(o(),m(p,{key:1},[c(r(j),{onPositiveClick:t[5]||(t[5]=()=>Pe(!1))},{trigger:l((()=>[v("div",de,[ve,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])])])),default:l((()=>[fe])),_:1}),r(Ue)?(o(),a(r(j),{key:0,onPositiveClick:t[6]||(t[6]=()=>Pe(!0))},{trigger:l((()=>[v("div",ge,[_e,c(r(I),{size:20,component:r(P),class:"item__right"},null,8,["component"])])])),default:l((()=>[ye])),_:1})):g("v-if",!0)],64)):g("v-if",!0)],64))])):g("v-if",!0)])),_:1})])),_:1}))}});export{ke as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as a,computed as
|
1
|
+
import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as n,unref as s,withCtx as r,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),n(s(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:r((()=>[i(e.$slots,"trigger")])),default:r((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(s(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\n\t\t\t\t\t\t\t\t<n-button\n\t\t\t\t\t\t\t\t\tcircle\n\t\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\n\t\t\t\t\t\t\t\t\t@click="handleClick"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t\t</n-upload-trigger>\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(s(w),{strong:"",secondary:"",onClick:W},{default:r((()=>[m(s(j),{size:"13",color:"#666666",component:s(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(s(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),n(s(j),{key:0,size:"16",color:"#666666",component:M.value?s(I):s(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(s(w),{circle:"",size:"small",secondary:""},{icon:r((()=>[m(s(j),{size:24,component:s(x),color:"#fff"},null,8,["component"])])),_:1}),m(s(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n,getFileSize as i}from"../utils/index.js";import{InjectionIChatState as r,InjectionIChatStompClient as o,InjectionIChatEmits as c}from"../types/index.js";import{MESSAGE_TYPE as m,CHAT_TYPE as a}from"../constants/index.js";import{useIntervalFn as T,promiseTimeout as d}from"@vueuse/core";import{openSessionApi as g}from"../api/index.js";function p(){const p=e(r),u=e(o),f=e(c),{pause:h,resume:l,isActive:y}=T((()=>{const e=t(p.msgList);e.some((e=>{const{sendTime:t}=e;return!(Date.now()-new Date(t).getTime()>=36e5)&&(e.__sendTime=s(t).recordTime,!0)})),p.msgList=e,v()||h()}),6e4,{immediate:!1});function v(){return!!p.msgList.length&&p.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function L(e){try{u.value.send("/app/chat/send",{},JSON.stringify({chatType:p.currentSessionItem.chatType,receiver:p.currentSessionItem.receiver,...e}))}catch(e){}}return{state:p,setMsgList:function(e=[]){h(),p.msgList=t(e).sort(((e,t)=>new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime())),p.msgList.forEach((e=>{var t,r;Object.assign(e,{__time:s(e.sendTime).msgTime,__content:(r=e.content.chatMessageType,[m.TEXT,m.TEXT,m.BLEND].includes(r)?n(e.content):null==(t=e.content)?void 0:t.msg),__sendTime:s(e.sendTime).recordTime}),e.content.chatMessageType!==m.FILE||e.__size||i(e.content.fileUrl).then((t=>{e.__size=t}))})),v()&&l()},stompClient:u,emit:f,sendMessage:L,relayMessage:async function(e){const{checkedIds:t,remark:s,content:n}=e;for(let e=0;e<t.length;e++){const i=t[e],r=p.sessionList.find((e=>e.receiver===i));r||await g({chatType:
|
1
|
+
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n,getFileSize as i}from"../utils/index.js";import{InjectionIChatState as r,InjectionIChatStompClient as o,InjectionIChatEmits as c}from"../types/index.js";import{MESSAGE_TYPE as m,CHAT_TYPE as a}from"../constants/index.js";import{useIntervalFn as T,promiseTimeout as d}from"@vueuse/core";import{openSessionApi as g}from"../api/index.js";function p(){const p=e(r),u=e(o),f=e(c),{pause:h,resume:l,isActive:y}=T((()=>{const e=t(p.msgList);e.some((e=>{const{sendTime:t}=e;return!(Date.now()-new Date(t).getTime()>=36e5)&&(e.__sendTime=s(t).recordTime,!0)})),p.msgList=e,v()||h()}),6e4,{immediate:!1});function v(){return!!p.msgList.length&&p.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function L(e){try{u.value.send("/app/chat/send",{},JSON.stringify({chatType:p.currentSessionItem.chatType,receiver:p.currentSessionItem.receiver,...e}))}catch(e){}}return{state:p,setMsgList:function(e=[]){h(),p.msgList=t(e).sort(((e,t)=>new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime())),p.msgList.forEach((e=>{var t,r;Object.assign(e,{__time:s(e.sendTime).msgTime,__content:(r=e.content.chatMessageType,[m.TEXT,m.TEXT,m.BLEND].includes(r)?n(e.content):null==(t=e.content)?void 0:t.msg),__sendTime:s(e.sendTime).recordTime}),e.content.chatMessageType!==m.FILE||e.__size||i(e.content.fileUrl).then((t=>{e.__size=t}))})),v()&&l()},stompClient:u,emit:f,sendMessage:L,relayMessage:async function(e){const{checkedIds:t,remark:s,content:n}=e;for(let e=0;e<t.length;e++){const i=t[e],r=p.sessionList.find((e=>e.receiver===i));r||await g({chatType:a.SINGLE,receiver:i,sender:p.userInfo.id});const o=(null==r?void 0:r.chatType)||a.SINGLE;L({chatType:o,receiver:i,content:n}),await d(100),s&&L({chatType:o,receiver:i,content:{chatMessageType:m.TEXT,msg:s}}),await d(100)}}}}export{p as useState};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as o,ref as t,watch as a,nextTick as n,openBlock as s,createElementBlock as i,normalizeClass as l,unref as r,createCommentVNode as m,Fragment as c,createBlock as u,mergeProps as d,createElementVNode as p,normalizeStyle as f,createVNode as v,withCtx as g,renderList as h,toDisplayString as k,createTextVNode as y,resolveDynamicComponent as w,renderSlot as S}from"vue";import b from"./hooks/use-noData.js";import{ScaleViewProps as C}from"./hooks/scaleview-props.js";import{getScaleViewState as D}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as j}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as _}from"./hooks/scaleview-submit.js";import{ScaleViewMethods as x}from"./hooks/scaleview-methods.js";import{handleQueryParams as F,isCollection as P}from"./utils/judge-types.js";import{useEvent as q}from"./hooks/use-event.js";import"xe-utils";import"moment";import L from"../../../shared/utils/vexutilsExpand.js";import N from"./components/NoData.vue.js";import R from"./components/EvaluateCountdown.vue.js";import A from"./components/EvaluatePage.vue.js";import M from"./components/AnswerParse.vue.js";import O from"./components/ScaleScore.js";import T from"./components/DescribeContent.vue.js";import{NForm as V,NFormItem as I,NButton as B}from"naive-ui";const J=["innerHTML"],G={key:0,class:"required-text"},W={key:1,class:"evalute-label"},H=["onClick"],Q=p("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),$={key:1,class:"footer"};var z=e({__name:"ScaleView",props:C,emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:C,emit:z}){const K=e,{ScaleViewState:U}=D(),X=o(U),Y=t(null),Z=t(null),ee=t(null),{noDataState:oe,setNoData:te,resetNodata:ae}=b(),ne=F(),{showEvatip:se,isFormBoldOpen:ie,scaleStyle:le,handlePageClass:re,isShowItem:me,handleShowQuestionNumber:ce,hasScore:ue,isPreviewScale:de,showEvaluateEntry:pe,showEvaluateCoundownPage:fe,showScaleFooter:ve,isCancelBtn:ge,isSaveBtn:he,showEvaluateLabel:ke,showAnswerParse:ye,propsConfig:we,evaluatePageProps:Se,evaluateCountdownProps:be,isEvaluetaResSituation:Ce,disableEdit:De,desStart:Ee,desEnd:je,desContent:_e}=E(K,X,{query:ne,scaleViewDom:Y}),{initForm:xe}=j(K,X,z,{query:ne}),{submitMethod:Fe,onSubmitData:Pe,onSubmitForm:qe,handleScoreJson:Le}=_(K,X,z,{query:ne,formRef:ee,countdownDom:Z}),{nextLogicEvent:Ne,handleDynamicDataRelation:Re}=q(K,X),{scaleChange:Ae,labelChange:Me,vodFileList:Oe,writeGuage:Te,closeEvaluateCountdown:Ve,showEvaTipModal:Ie}=x(K,X,z,{nextLogicEvent:Ne,handleDynamicDataRelation:Re,isPreviewScale:de,submitMethod:Fe,isEvaluetaResSituation:Ce,handleScoreJson:Le,disableEdit:De});(()=>{let{id:e}=ne;e&&(X.shareId=e)})();const Be=e=>{try{ae(),xe(e)}catch(e){console.log(e,"--error"),X.spinning=!1,X.hasFrontAddress=!1,te(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};a((()=>K.ids),((e,o)=>{o?e.guage_id&&e.guage_id!=o.guage_id&&Be(e):e.guage_id&&Be(e)}),{immediate:!0}),a((()=>K.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;X.form={},X.formArray=[];const o=JSON.parse(JSON.stringify(e));n((()=>{xe(o)}))}),{immediate:!0});const Je=L.debounce(Pe,300),Ge=()=>{z("onCloseSetting")};return C({getScaleData:()=>({...X}),onSubmitForm:qe,cancel:Ge}),(e,o)=>(s(),i("div",{class:l(["c-scale-view-block",{"c-scale-view-block-hasfooter":r(ve)}]),ref_key:"scaleViewDom",ref:Y},[m(' <template v-if="state.spinning">\
|
1
|
+
import{defineComponent as e,reactive as o,ref as t,watch as a,nextTick as n,openBlock as s,createElementBlock as i,normalizeClass as l,unref as r,createCommentVNode as m,Fragment as c,createBlock as u,mergeProps as d,createElementVNode as p,normalizeStyle as f,createVNode as v,withCtx as g,renderList as h,toDisplayString as k,createTextVNode as y,resolveDynamicComponent as w,renderSlot as S}from"vue";import b from"./hooks/use-noData.js";import{ScaleViewProps as C}from"./hooks/scaleview-props.js";import{getScaleViewState as D}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as j}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as _}from"./hooks/scaleview-submit.js";import{ScaleViewMethods as x}from"./hooks/scaleview-methods.js";import{handleQueryParams as F,isCollection as P}from"./utils/judge-types.js";import{useEvent as q}from"./hooks/use-event.js";import"xe-utils";import"moment";import L from"../../../shared/utils/vexutilsExpand.js";import N from"./components/NoData.vue.js";import R from"./components/EvaluateCountdown.vue.js";import A from"./components/EvaluatePage.vue.js";import M from"./components/AnswerParse.vue.js";import O from"./components/ScaleScore.js";import T from"./components/DescribeContent.vue.js";import{NForm as V,NFormItem as I,NButton as B}from"naive-ui";const J=["innerHTML"],G={key:0,class:"required-text"},W={key:1,class:"evalute-label"},H=["onClick"],Q=p("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),$={key:1,class:"footer"};var z=e({__name:"ScaleView",props:C,emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:C,emit:z}){const K=e,{ScaleViewState:U}=D(),X=o(U),Y=t(null),Z=t(null),ee=t(null),{noDataState:oe,setNoData:te,resetNodata:ae}=b(),ne=F(),{showEvatip:se,isFormBoldOpen:ie,scaleStyle:le,handlePageClass:re,isShowItem:me,handleShowQuestionNumber:ce,hasScore:ue,isPreviewScale:de,showEvaluateEntry:pe,showEvaluateCoundownPage:fe,showScaleFooter:ve,isCancelBtn:ge,isSaveBtn:he,showEvaluateLabel:ke,showAnswerParse:ye,propsConfig:we,evaluatePageProps:Se,evaluateCountdownProps:be,isEvaluetaResSituation:Ce,disableEdit:De,desStart:Ee,desEnd:je,desContent:_e}=E(K,X,{query:ne,scaleViewDom:Y}),{initForm:xe}=j(K,X,z,{query:ne}),{submitMethod:Fe,onSubmitData:Pe,onSubmitForm:qe,handleScoreJson:Le}=_(K,X,z,{query:ne,formRef:ee,countdownDom:Z}),{nextLogicEvent:Ne,handleDynamicDataRelation:Re}=q(K,X),{scaleChange:Ae,labelChange:Me,vodFileList:Oe,writeGuage:Te,closeEvaluateCountdown:Ve,showEvaTipModal:Ie}=x(K,X,z,{nextLogicEvent:Ne,handleDynamicDataRelation:Re,isPreviewScale:de,submitMethod:Fe,isEvaluetaResSituation:Ce,handleScoreJson:Le,disableEdit:De});(()=>{let{id:e}=ne;e&&(X.shareId=e)})();const Be=e=>{try{ae(),xe(e)}catch(e){console.log(e,"--error"),X.spinning=!1,X.hasFrontAddress=!1,te(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};a((()=>K.ids),((e,o)=>{o?e.guage_id&&e.guage_id!=o.guage_id&&Be(e):e.guage_id&&Be(e)}),{immediate:!0}),a((()=>K.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;X.form={},X.formArray=[];const o=JSON.parse(JSON.stringify(e));n((()=>{xe(o)}))}),{immediate:!0});const Je=L.debounce(Pe,300),Ge=()=>{z("onCloseSetting")};return C({getScaleData:()=>({...X}),onSubmitForm:qe,cancel:Ge}),(e,o)=>(s(),i("div",{class:l(["c-scale-view-block",{"c-scale-view-block-hasfooter":r(ve)}]),ref_key:"scaleViewDom",ref:Y},[m(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),X.spinning||X.hasFrontAddress?m("v-if",!0):(s(),i(c,{key:0},[r(oe).noData?(s(),u(N,{key:0,noDataImg:r(oe).noDataImg,noDataTip:r(oe).noDataTip},null,8,["noDataImg","noDataTip"])):(s(),i(c,{key:1},[r(pe)?(s(),u(A,d({key:0},r(Se),{onWriteGuage:r(Te)}),null,16,["onWriteGuage"])):(s(),i(c,{key:1},[r(fe)?(s(),u(R,d({key:0,ref_key:"countdownDom",ref:Z},r(be),{onCloseEvaluateCountdown:r(Ve)}),null,16,["onCloseEvaluateCountdown"])):m("v-if",!0),p("div",{class:l(["scale-container",{"scale-container-nopadding":r(re),"scale-container-hasfooter":r(ve)}]),style:f(r(le))},[r(ue)?(s(),u(r(O),{key:0,config:X.config,maxScore:X.maxScore},null,8,["config","maxScore"])):m("v-if",!0),r(Ee)?(s(),u(T,{key:1,content:r(_e)},null,8,["content"])):m("v-if",!0),v(r(V),{ref_key:"formRef",ref:ee,model:X.form,rules:X.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(s(!0),i(c,null,h(X.formArray,((e,o)=>(s(),i(c,{key:(e.id||e.seq)+o},[r(me)(e)?(s(),u(r(I),{key:0,path:e.val_key,"show-label":!r(P)(e.type),class:"c-scle-form-item"},{label:g((()=>[p("span",{class:l({"scale-label-required":r(ie)(e)}),innerHTML:r(ce)(e)},null,10,J),r(ie)(e)?(s(),i("span",G,"(必填)")):m("v-if",!0),r(ke)(e)?(s(),i("span",W,k(r(ke)(e)),1)):m("v-if",!0),r(se)(e)?(s(),i("span",{key:2,class:"evalute-tip",onClick:o=>r(Ie)(e)},[Q,y(" 查看提示 ")],8,H)):m("v-if",!0)])),default:g((()=>[(s(),u(w(e.renderCom),d(r(we)(e,o),{key:(e.id||e.seq)+o,onScaleChange:r(Ae),onOnChange:o=>r(Me)(o,e),onVodFileList:r(Oe)}),null,16,["onScaleChange","onOnChange","onVodFileList"])),r(ye)(e)?(s(),u(M,{key:0,item:e},null,8,["item"])):m("v-if",!0)])),_:2},1032,["path","show-label"])):m("v-if",!0)],64)))),128))])),_:1},8,["model","rules"]),r(je)?(s(),u(T,{key:2,content:r(_e)},null,8,["content"])):m("v-if",!0)],6),r(ve)?(s(),i("div",$,[m(" 分享的链接 隐藏取消按钮 "),r(ge)?(s(),u(r(B),{key:0,onClick:Ge},{default:g((()=>[y("取消")])),_:1})):m("v-if",!0),r(he)?(s(),u(r(B),{key:1,onClick:r(Je),disabled:X.banSubmit,type:"primary"},{default:g((()=>[y(" 保存 ")])),_:1},8,["onClick","disabled"])):m("v-if",!0),S(e.$slots,"extendBtn")])):m("v-if",!0)],64))],64))],64))],2))}});export{z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as
|
1
|
+
import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../shared/utils/vexutilsExpand.js";const A={key:0,class:"label-disable-wrap"},O=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},j={class:"label-wrap"},k=["id"],T={class:"edit-label-type"};var B=t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:B,emit:D}){const V=t,F=L(),P=e(null),_=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!_.inited)return!1;let t=_.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(..._.labelSelectedEdit,...V.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(_.labelSelectedEdit=$.value,"object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=_.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await V.saveLabelItem(a,t);i&&(F.success("添加成功!"),D("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=_.labelSelectedEdit)?void 0:i.length)&&x.clone(_.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}_.labelSelectedEdit=[...d],N.value++,V.explicit&&D("explicitOnChange",[..._.labelSelectedEdit])},X=async t=>{const{status:e}=await V.deleteLabel(t,V.item);if(e){F.success("删除成功!");for(const e in _.labelConfig){const l=_.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&_.labelConfig[e].itemList.splice(l,1)}const e=_.labelSelectedEdit||[],l=V.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),D("change",[...l],V.item)}D("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=P.value.querySelector("a[href='"+l+"']"),e&&e.click(),_.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);_.cacheAnchorKey=e},et=()=>{var t;return null==(t=P.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>V.labelOptions),(t=>{t&&(()=>{var t;if(V.isLock)return;const e=JSON.parse(JSON.stringify(V.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}_.labelConfig=e,C((()=>{let t;R(),V.explicit&&_.inited&&(t=_.labelAnchorKey),z(_.labelConfig,t),_.inited=!0}))})()}),{immediate:!0,deep:!0}),B({resetShowAdd:()=>{let{labelObj:t}=_.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([..._.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=_.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(_.labelSelectedEdit)){const e=_.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&_.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:P},[d(W)?(n(),s("div",A,O)):o("v-if",!0),r(c("div",K,[c("div",j,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(_.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(_.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",T,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,k),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}});export{B as default};
|