cnhis-design-vue 3.2.10-beta.4 → 3.2.10-beta.6
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/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.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/components/table-filter/src/components/render-widget/components/index.d.ts +4 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
- 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/logo.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';
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as d,isRef as s,createSlots as i,renderList as p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as h}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as D,isNumber as k}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as S,startOfDay as _,endOfDay as A}from"date-fns";var I=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"}},emits:["update:formatted-value"],setup(e,{expose:I,emit:M}){const R=e,C=t(),$=a(null),b=a(null),j=a();let P="";const U=l({get:()=>z(R.formattedValue)?null:R.formattedValue,set(e){g(e)&&g(P)&&w(P,e)||P===e||(M("update:formatted-value",e,D(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),P=e)}}),q=l((()=>R.type.includes("datetime"))),x=l((()=>Reflect.get(C,"format")?C.format:q.value?"yyyy-MM-dd HH:mm:ss":"month"===R.type?"yyyy-MM":"year"===R.type?"yyyy":"yyyy-MM-dd")),E=l((()=>q.value?x.value.split(" "):"")),{focus:F,blur:H,handleConfirm:L}=v($,{formatRef:x,attrs:{...C,type:R.type},emit:M,allowedInvalidValue:R.allowedInvalidValue});async function B(e){!async function(e){var t;if(!e||!R.holidays.length)return;await f();const a=null==(t=$.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;O(),"daterange"===R.type?Y.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):"date"===R.type&&Y.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!k(n))return;const o=new Date(n);R.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&q.value&&(await f(),async function e(t=0){var a;t>2||(b.value=null==(a=$.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:E,attrs:{...C,type:R.type},isPanel:!0}):(await f(),e(++t)))}())}const Y=[];function O(){Y.forEach((e=>e())),Y.length=0}async function T(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=$.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(R.type.includes("range")?null==(o=R.onConfirm)||o.call(R,...e):(await f(),u.focus(),L(u),u.blur(),null==(r=R.onConfirm)||r.call(R,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!R.updateUnchangedValue||R.type.includes("range"))return;const d=u.value;h(u,V(new Date,x.value)),h(u,d)}function z(e){return R.allowedInvalidValue&&R.allowedInvalidValue===e}return n(O),o((()=>R.formattedValue),(e=>{j.value=z(e)?e:R.placeholder?R.placeholder:"选择日期时间",z(e)||(P=e)}),{immediate:!0}),I({$datePicker:$,focus:F,blur:H,setShortcutValue:async function(e){if(!R.type||!R.type.includes("range")||!$.value)return;const t=$.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=S(n,{weeks:1});a=V(_(e),x.value)}else{const e=S(n,{months:1});a=V(_(e),x.value)}l=V(A(n),x.value),h(t[0],a),await f(),h(t[1],l)}}),(t,a)=>(r(),u(d(m),{ref_key:"datePickerRef",ref:$,"onUpdate:show":B,onConfirm:T,placeholder:j.value,to:e.to,type:e.type,"formatted-value":d(U),"onUpdate:formatted-value":a[0]||(a[0]=e=>s(U)?U.value=e:null)},i({_:2},[p(t.$slots,((e,a)=>({name:a,fn:c((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value"]))}});export{I as default};
|
@@ -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};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock 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};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{inject as e,createVNode as t,mergeProps as o}from"vue";import{NInput as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as i}from"../../../constants/index.js";import{useAutoFocus as a}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as l}from"../../../utils/index.js";import{defineTablePlugin as s}from"../../../hooks/useTablePlugin.js";import{getSeparateInfo as d}from"../../../utils/separateMap.js";function u(){const u="inputRendererPlugins";return s({name:u,vxe(a){let s="";a.renderer.add(r.INPUT,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:r,row:a,rowIndex:l,column:u,emitFormChangeWithParams:m,emitFormClickWithParams:c,$table:f})=>{let p=l,g=a;if("bottom"===r.separatePlacement){const t=e(i),o=d(t,a);if(o&&o.isLastRow&&a!==o.originalData){const{originalData:e=a,index:t}=o;g=e,p=t}}return[t(n,o({value:g[u.field],"onUpdate:value":e=>g[u.field]=e},r.componentProps,{onChange:()=>{m({oldValue:s,index:p,row:g,value:g[u.field]})},onClick:()=>c({index:p,row:g,value:g[u.field]}),onFocus:()=>s=g[u.field],onKeydown:async e=>{if("Enter"!==e.key)return;const{fullData:t}=f.getTableData();if(t.length!==l+1)return;const{editStore:{actived:o}={}}=f.reactData;if(o&&o.row){const t=o.args;await f.clearEdit(),f.handleSelected(t,e)}}}),null)]}))})},apply(e){a(e).bindAutoFocusConfig(u,r.INPUT,".n-input__input-el",{focusType:"class"})}})}export{u as inputRendererPlugin};
|
1
|
+
import{inject as e,createVNode as t,mergeProps as o}from"vue";import{NInput as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as i}from"../../../constants/index.js";import{useAutoFocus as a}from"./hooks/useAutoFocus.js";import{IhoTableRenderHelper as l}from"../../../utils/index.js";import{defineTablePlugin as s}from"../../../hooks/useTablePlugin.js";import{getSeparateInfo as d}from"../../../utils/separateMap.js";function u(){const u="inputRendererPlugins";return s({name:u,vxe(a){let s="";a.renderer.add(r.INPUT,{renderCell:l.createDefaultRenderCell(),renderEdit:l.createRenderEdit((({fieldItem:r,row:a,rowIndex:l,column:u,emitFormChangeWithParams:m,emitFormClickWithParams:c,$table:f})=>{let p=l,g=a;if("bottom"===r.separatePlacement){const t=e(i),o=d(t,a);if(o&&o.isLastRow&&a!==o.originalData){const{originalData:e=a,index:t}=o;g=e,p=t}}return[t(n,o({value:g[u.field],"onUpdate:value":e=>g[u.field]=e},r.componentProps,{onChange:()=>{m({oldValue:s,index:p,row:g,value:g[u.field]})},onClick:()=>c({index:p,row:g,value:g[u.field]}),onFocus:()=>s=g[u.field],onKeydown:async e=>{if("Enter"!==e.key)return;const{fullData:t}=f.getTableData();if(t.length!==l+1)return;const{editStore:{actived:o}={}}=f.reactData;if(o&&o.row){const t=o.args;await f.clearEdit(),f.handleSelected(t,e)}}}),null)]}))})},apply(e){a(e).bindAutoFocusConfig(u,r.INPUT,".n-input__input-el,.n-input__textarea-el",{focusType:"class"})}})}export{u as inputRendererPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as
|
1
|
+
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,noop as l,range as d,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function s(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function h(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function _(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function m(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void d(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const i=r[n-1];i&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===i[n]&&r&&n!==`header_${t}`&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return h(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const x=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el,.n-input__textarea-el");return n&&n.click(),n};function w(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function $(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?w:i(u)?o(u):a(u)?u:w;let c=r.getTableConfig("verticalConfig.bodyWidth");c=i(c)?o(c):a(c)?c:l;let s=r.getTableConfig("verticalConfig.bodyMinWidth");return s=i(s)?o(s):a(s)?s:o(120),[...d(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:s(n),width:c(n),editRender:{name:f,props:{},enable:!0,autofocus:x}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function b(e){return u("originalField")(e)}function v(e,n){return u(`originalData.${n}`)(e)}function I(e,n){const t=_(n.field),r=b(e);return{row:v(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[_(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(h(r))return e[r];if(p(r)){const t=_(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!h(r)){const t=_(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}function W({$columnIndex:e,$rowIndex:n,column:t,columnIndex:r,row:i,rowIndex:o,type:a,_columnIndex:l,_rowIndex:d},u){var c;if(t){const f=a;if(a=h(t.field)?"header":"body",i){const s=_(t.field);t=b(i),i="header"===a?void 0:v(i,s),l=r=e="header"===f?n||0:((null==(c=u.fixedLeftVerticalData)?void 0:c.length)||0)+(n||0),d=o=n="header"===a?-1:s}}return{column:t,row:i,_columnIndex:l,_rowIndex:d,columnIndex:r,rowIndex:o,$columnIndex:e,$rowIndex:n,type:a}}x.toString=()=>"input,.n-input__input-el";export{W as basicParamsConvert,m as bindHeaderInfoAndFlatten,D as createDataProxy,$ as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,_ as getHeaderDepthByField,I as getOriginBasePayload,b as getOriginFieldFromRowData,v as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,h as isVerticalHeader,s as isVerticalTable};
|
@@ -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};
|
@@ -962,7 +962,7 @@ declare const DateRangeInner: import("vue").DefineComponent<{
|
|
962
962
|
}>;
|
963
963
|
declare const DateRangeOut: import("vue").DefineComponent<{
|
964
964
|
type: {
|
965
|
-
type: import("vue").PropType<"
|
965
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
966
966
|
default: string;
|
967
967
|
};
|
968
968
|
clearable: {
|
@@ -988,7 +988,7 @@ declare const DateRangeOut: import("vue").DefineComponent<{
|
|
988
988
|
}, {
|
989
989
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
990
990
|
type: {
|
991
|
-
type: import("vue").PropType<"
|
991
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
992
992
|
default: string;
|
993
993
|
};
|
994
994
|
clearable: {
|
@@ -1148,7 +1148,7 @@ declare const DateRangeOut: import("vue").DefineComponent<{
|
|
1148
1148
|
}>>;
|
1149
1149
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1150
1150
|
type: {
|
1151
|
-
type: import("vue").PropType<"
|
1151
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
1152
1152
|
default: string;
|
1153
1153
|
};
|
1154
1154
|
clearable: {
|
@@ -1174,7 +1174,7 @@ declare const DateRangeOut: import("vue").DefineComponent<{
|
|
1174
1174
|
}>> & {
|
1175
1175
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
1176
1176
|
}, {
|
1177
|
-
type: "
|
1177
|
+
type: "daterange" | "datetimerange";
|
1178
1178
|
value: string;
|
1179
1179
|
componentCfg: Record<string, any>;
|
1180
1180
|
clearable: boolean;
|
@@ -1320,7 +1320,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
1320
1320
|
} | {
|
1321
1321
|
component: import("vue").DefineComponent<{
|
1322
1322
|
type: {
|
1323
|
-
type: import("vue").PropType<"
|
1323
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
1324
1324
|
default: string;
|
1325
1325
|
};
|
1326
1326
|
clearable: {
|
@@ -1346,7 +1346,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
1346
1346
|
}, {
|
1347
1347
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1348
1348
|
type: {
|
1349
|
-
type: import("vue").PropType<"
|
1349
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
1350
1350
|
default: string;
|
1351
1351
|
};
|
1352
1352
|
clearable: {
|
@@ -1506,7 +1506,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
1506
1506
|
}>>;
|
1507
1507
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1508
1508
|
type: {
|
1509
|
-
type: import("vue").PropType<"
|
1509
|
+
type: import("vue").PropType<"daterange" | "datetimerange">;
|
1510
1510
|
default: string;
|
1511
1511
|
};
|
1512
1512
|
clearable: {
|
@@ -1532,7 +1532,7 @@ export declare const WidgetCfgMaps: Map<string, {
|
|
1532
1532
|
}>> & {
|
1533
1533
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
1534
1534
|
}, {
|
1535
|
-
type: "
|
1535
|
+
type: "daterange" | "datetimerange";
|
1536
1536
|
value: string;
|
1537
1537
|
componentCfg: Record<string, any>;
|
1538
1538
|
clearable: boolean;
|
package/es/env.d.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
/// <reference types="vite/client" />
|
2
|
-
|
3
|
-
interface ImportMetaEnv {
|
4
|
-
readonly VITE_APP_TYPE: string;
|
5
|
-
// 更多环境变量...
|
6
|
-
}
|
7
|
-
|
8
|
-
interface ImportMeta {
|
9
|
-
readonly env: ImportMetaEnv;
|
10
|
-
}
|
11
|
-
|
12
|
-
declare module '*.vue' {
|
13
|
-
// @ts-ignore
|
14
|
-
import type { App, defineComponent } from 'vue';
|
15
|
-
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
16
|
-
// // const component: DefineComponent<{}, {}, any>
|
17
|
-
const component: ReturnType<typeof defineComponent> & {
|
18
|
-
install(app: App): void;
|
19
|
-
};
|
20
|
-
// @ts-ignore
|
21
|
-
export default component;
|
22
|
-
}
|
23
|
-
|
24
|
-
declare module '*.js';
|
25
|
-
|
1
|
+
/// <reference types="vite/client" />
|
2
|
+
|
3
|
+
interface ImportMetaEnv {
|
4
|
+
readonly VITE_APP_TYPE: string;
|
5
|
+
// 更多环境变量...
|
6
|
+
}
|
7
|
+
|
8
|
+
interface ImportMeta {
|
9
|
+
readonly env: ImportMetaEnv;
|
10
|
+
}
|
11
|
+
|
12
|
+
declare module '*.vue' {
|
13
|
+
// @ts-ignore
|
14
|
+
import type { App, defineComponent } from 'vue';
|
15
|
+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
16
|
+
// // const component: DefineComponent<{}, {}, any>
|
17
|
+
const component: ReturnType<typeof defineComponent> & {
|
18
|
+
install(app: App): void;
|
19
|
+
};
|
20
|
+
// @ts-ignore
|
21
|
+
export default component;
|
22
|
+
}
|
23
|
+
|
24
|
+
declare module '*.js';
|
25
|
+
|
@@ -1 +1 @@
|
|
1
|
-
var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAABGdBTUEAALGPC/
|
1
|
+
var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAkUExURYN/+1t1/2R3+Vt2+V91+XR6+lB1+GJ4+T1y9////6Kv/djc/q/lHBQAAAAFdFJOU/4Bj79H7F+1EQAAAd1JREFUKM9VkzFPG0EQhUeRDstUHEmU9iwRaElQqAlSUp8Cy8bQkWTvgAaQbkexKzA6bUkTWXNuUmGd+2BZ/Dlmdn3YmeZ0n97sm5mdhTjEfgLwcWP+A+HDiCN6tQw9i6JIfVvAPa9LU6XUYQPXF0ypzhxuByhI64MAX3umIqFFgR88TJaECvW1wDfe2Qu11gXiZ4ZrL0KtGCFeMUyCULJRCzxlGOo+nkwmWl8+tdDaGKRIlao2EaHu09Ra2wE+MgKlaoYt/E3DLDNXsMe5rJzRjMbYo7G15ickbBypY7o/oSligcaYU0hkOOqE/vVoiDg5YuUP2PatdGncoz/YpwdWDqRphinogio8oxWGRmx4DqstxNmI3RnmOfghppzK0HbpyJiy9E0XfXGuiaFlVsIn0XFU2KaHNnFyPhDYFzjkAwWWpRvAe1V0BU6zC3qsqcydu4UvWqerVIG1XH09EuUdvOVrCcM5p/t6xEJ3A+taI/eDmflFVV05ph2IedbpX2ssN9K6/C5KnvwW0yyz0p64sA/Ddx565kqBN3LFDRNjCbnieIudhbl8nu3XBr0wD8yFtYl37RIbNKu4dKBrVjH+KsJgfbdY702Z4txl8RA2Q+7tf68j3t9xbqd5Ms+7o/4I2Ue8YgAAAABJRU5ErkJggg==";export{A as default};
|