yahee-components 0.0.6 → 0.0.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as R, ref as d, reactive as $, onMounted as K, openBlock as c, createElementBlock as u, createVNode as s, unref as n, normalizeStyle as A, withCtx as x, Fragment as
|
|
1
|
+
import { defineComponent as R, ref as d, reactive as $, onMounted as K, openBlock as c, createElementBlock as u, createVNode as s, unref as n, normalizeStyle as A, withCtx as x, Fragment as y, renderList as G, normalizeClass as J, createElementVNode as l, toDisplayString as p, createCommentVNode as w, withDirectives as Q, vModelText as q, createTextVNode as W } from "vue";
|
|
2
2
|
import { CaretRight as X, CaretLeft as Z } from "@element-plus/icons-vue";
|
|
3
3
|
import { RemarkApi as L } from "../packages/components/api/remarkApi.js";
|
|
4
|
-
import { ElScrollbar as ee, ElIcon as
|
|
4
|
+
import { ElScrollbar as ee, ElIcon as B, ElButton as te, ElMessage as f } from "element-plus";
|
|
5
5
|
import "element-plus/theme-chalk/src/base.scss";
|
|
6
6
|
import "element-plus/theme-chalk/src/badge.scss";
|
|
7
7
|
import "element-plus/theme-chalk/src/message.scss";
|
|
@@ -23,14 +23,14 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
23
23
|
}, _e = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "no-more text-color-a4"
|
|
26
|
-
}, xe = ["placeholder"],
|
|
27
|
-
name: "
|
|
26
|
+
}, xe = ["placeholder"], Ie = { class: "d-flex text-right marginT10" }, Ye = /* @__PURE__ */ R({
|
|
27
|
+
name: "YaheeOperationLog",
|
|
28
28
|
__name: "operation-log",
|
|
29
29
|
props: {
|
|
30
30
|
projectId: { default: "" }
|
|
31
31
|
},
|
|
32
32
|
setup(P) {
|
|
33
|
-
const
|
|
33
|
+
const I = P, m = d(!1), C = d(!1), _ = d(!1), D = d({}), i = $({
|
|
34
34
|
List: [],
|
|
35
35
|
LoginId: ""
|
|
36
36
|
}), g = d(""), v = d([]), a = {
|
|
@@ -46,7 +46,7 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
46
46
|
e.append(
|
|
47
47
|
"filter",
|
|
48
48
|
JSON.stringify({
|
|
49
|
-
BusinessKey:
|
|
49
|
+
BusinessKey: I.projectId,
|
|
50
50
|
BusinessName: "PRODUCT_DEV",
|
|
51
51
|
PageIndex: a.PageIndex,
|
|
52
52
|
StartOn: a.StartOn,
|
|
@@ -75,14 +75,14 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
75
75
|
});
|
|
76
76
|
}, M = (e) => {
|
|
77
77
|
const t = new FormData();
|
|
78
|
-
return t.append("BusinessKey",
|
|
78
|
+
return t.append("BusinessKey", I.projectId), t.append("BusinessName", "PRODUCT_DEV"), t.append("notes", e.fileUrl), t.append("ViewTitle", e.fileName), L.insertglobalnotes(t);
|
|
79
79
|
}, j = () => {
|
|
80
80
|
if (!g.value) {
|
|
81
81
|
f.info(r("备注不能为空!"));
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
const e = new FormData();
|
|
85
|
-
e.append("BusinessKey",
|
|
85
|
+
e.append("BusinessKey", I.projectId), e.append("BusinessName", "PRODUCT_DEV"), e.append("notes", g.value), e.append("ViewTitle", "备注"), L.insertglobalnotes(e).then(async () => {
|
|
86
86
|
f.success(r("添加备注成功!")), a.PageIndex = 0, g.value = "", await h(), k();
|
|
87
87
|
});
|
|
88
88
|
}, Y = (e) => {
|
|
@@ -108,10 +108,10 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
108
108
|
}
|
|
109
109
|
}, N = d(null), k = () => {
|
|
110
110
|
N.value.scrollTo({ top: 0, behavior: "smooth" });
|
|
111
|
-
}, E = d(0),
|
|
111
|
+
}, E = d(0), O = d(null);
|
|
112
112
|
return K(() => {
|
|
113
113
|
const e = document.getElementsByClassName("log-form")[0].clientHeight;
|
|
114
|
-
E.value = window.innerHeight - e -
|
|
114
|
+
E.value = window.innerHeight - e - O.value.offsetHeight - 90, V();
|
|
115
115
|
}), (e, t) => (c(), u("div", re, [
|
|
116
116
|
s(ne, {
|
|
117
117
|
ref: "logForm",
|
|
@@ -126,11 +126,11 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
126
126
|
style: A({ height: E.value + "px" })
|
|
127
127
|
}, {
|
|
128
128
|
default: x(() => [
|
|
129
|
-
(c(!0), u(
|
|
129
|
+
(c(!0), u(y, null, G(i.List, (o) => (c(), u("div", {
|
|
130
130
|
key: o.Id,
|
|
131
131
|
class: J(i.LoginId == o.CreatedBy ? "list-item-right" : "list-item-left")
|
|
132
132
|
}, [
|
|
133
|
-
i.LoginId == o.CreatedBy ? (c(), u(
|
|
133
|
+
i.LoginId == o.CreatedBy ? (c(), u(y, { key: 0 }, [
|
|
134
134
|
l("div", null, [
|
|
135
135
|
l("div", de, [
|
|
136
136
|
l("div", ce, [
|
|
@@ -139,7 +139,7 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
139
139
|
info: o
|
|
140
140
|
}, null, 8, ["id", "info"])
|
|
141
141
|
]),
|
|
142
|
-
s(n(
|
|
142
|
+
s(n(B), {
|
|
143
143
|
color: "#f1f1f1",
|
|
144
144
|
size: "20"
|
|
145
145
|
}, {
|
|
@@ -152,11 +152,11 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
152
152
|
l("div", ue, p(n(b)(o.CreatedOnStr).format("YYYY-MM-DD HH: mm: ss")), 1)
|
|
153
153
|
]),
|
|
154
154
|
l("div", pe, p(o.CreatedName), 1)
|
|
155
|
-
], 64)) : (c(), u(
|
|
155
|
+
], 64)) : (c(), u(y, { key: 1 }, [
|
|
156
156
|
l("div", fe, p(o.CreatedName), 1),
|
|
157
157
|
l("div", null, [
|
|
158
158
|
l("div", me, [
|
|
159
|
-
s(n(
|
|
159
|
+
s(n(B), {
|
|
160
160
|
color: "#ccc",
|
|
161
161
|
size: "20"
|
|
162
162
|
}, {
|
|
@@ -180,14 +180,14 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
180
180
|
distance: 10,
|
|
181
181
|
onInfinite: V
|
|
182
182
|
}),
|
|
183
|
-
m.value ? (c(), u("div", he, p(n(r)("加载中...")), 1)) :
|
|
184
|
-
C.value ? (c(), u("div", _e, p(n(r)("没有更多了!")), 1)) :
|
|
183
|
+
m.value ? (c(), u("div", he, p(n(r)("加载中...")), 1)) : w("", !0),
|
|
184
|
+
C.value ? (c(), u("div", _e, p(n(r)("没有更多了!")), 1)) : w("", !0)
|
|
185
185
|
]),
|
|
186
186
|
_: 1
|
|
187
187
|
}, 8, ["style"]),
|
|
188
188
|
Q(l("textarea", {
|
|
189
189
|
ref_key: "logText",
|
|
190
|
-
ref:
|
|
190
|
+
ref: O,
|
|
191
191
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => g.value = o),
|
|
192
192
|
class: "content-div",
|
|
193
193
|
placeholder: n(r)("可通过 Ctrl+V 直接上传图片/文件"),
|
|
@@ -196,7 +196,7 @@ const re = { class: "yahee-operation-log" }, de = { class: "d-flex jc-end" }, ce
|
|
|
196
196
|
}, null, 40, xe), [
|
|
197
197
|
[q, g.value]
|
|
198
198
|
]),
|
|
199
|
-
l("div",
|
|
199
|
+
l("div", Ie, [
|
|
200
200
|
s(le, {
|
|
201
201
|
modelValue: v.value,
|
|
202
202
|
"onUpdate:modelValue": t[1] || (t[1] = (o) => v.value = o),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),y=require("@element-plus/icons-vue"),g=require("../packages/components/api/remarkApi.js"),s=require("element-plus");require("element-plus/theme-chalk/src/base.scss");require("element-plus/theme-chalk/src/badge.scss");require("element-plus/theme-chalk/src/message.scss");require("element-plus/theme-chalk/src/scrollbar.scss");require("element-plus/theme-chalk/src/button.scss");const U=require("../packages/components/hooks/useUpload.js"),O=require("../packages/components/hooks/useImg.js"),P=require("./operation-log-form.vue.js"),I=require("./operation-log-content.vue.js"),b=require("./operation-log-dialog.vue.js"),M=require("../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"),r=require("../utils/translate.js"),F=require("../annex-upload/annex-upload.vue.js"),T=require("../node_modules/.pnpm/v3-infinite-loading@1.3.2/node_modules/v3-infinite-loading/lib/v3-infinite-loading.es.js");;/* empty css */const j={class:"yahee-operation-log"},H={class:"d-flex jc-end"},Y={class:"content text-color-secondary"},z={class:"date fontSize-12 pull-right text-color-a4"},R={class:"name"},A={class:"name"},K={class:"d-flex"},G={class:"content text-color-secondary"},J={class:"date fontSize-12 text-color-a4"},Q={key:0,class:"loading text-color-a4"},$={key:1,class:"no-more text-color-a4"},W=["placeholder"],X={class:"d-flex text-right marginT10"},Z=e.defineComponent({name:"YaheeOperationLog",__name:"operation-log",props:{projectId:{default:""}},setup(k){const f=k,i=e.ref(!1),m=e.ref(!1),p=e.ref(!1),v=e.ref({}),l=e.reactive({List:[],LoginId:""}),c=e.ref(""),d=e.ref([]),a={PageIndex:-1,StartOn:"",EndOn:"",Notes:"",Mark:null,UserIds:[]},u=()=>{i.value=!0;const t=new FormData;t.append("filter",JSON.stringify({BusinessKey:f.projectId,BusinessName:"PRODUCT_DEV",PageIndex:a.PageIndex,StartOn:a.StartOn,EndOn:a.EndOn,UserIds:a.UserIds,Notes:a.Notes,Mark:a.Mark})),g.RemarkApi.findGlobalNotes(t).then(n=>{var o;l.LoginId=n.LoginId,a.PageIndex===0?l.List=n.List||[]:l.List=[...l.List||[],...n.List||[]],((o=n==null?void 0:n.List)==null?void 0:o.length)===0&&(m.value=!0)}).finally(()=>{i.value=!1})},_=()=>{i.value||(i.value=!0,a.PageIndex+=1,u())},D=t=>{l.List=[],a.PageIndex=0,a.StartOn=t.timeValue?t.timeValue[0]:"",a.EndOn=t.timeValue?t.timeValue[1]:"",a.UserIds=t.CreatedBy?[t.CreatedBy]:[],a.Notes=t.search,a.Mark=t.Mark,u()},L=()=>{d.value.length>0&&h(d.value[0]).then(async()=>{s.ElMessage.success(r.M2("上传文件成功!")),a.PageIndex=0,d.value=[],await u(),N()})},C=t=>{h(t).then(()=>{s.ElMessage.success(r.M2("上传文件成功!")),p.value=!1,a.PageIndex=0,u()})},h=t=>{const n=new FormData;return n.append("BusinessKey",f.projectId),n.append("BusinessName","PRODUCT_DEV"),n.append("notes",t.fileUrl),n.append("ViewTitle",t.fileName),g.RemarkApi.insertglobalnotes(n)},B=()=>{if(!c.value){s.ElMessage.info(r.M2("备注不能为空!"));return}const t=new FormData;t.append("BusinessKey",f.projectId),t.append("BusinessName","PRODUCT_DEV"),t.append("notes",c.value),t.append("ViewTitle","备注"),g.RemarkApi.insertglobalnotes(t).then(async()=>{s.ElMessage.success(r.M2("添加备注成功!")),a.PageIndex=0,c.value="",await u(),N()})},q=t=>{if(t.clipboardData||t.originalEvent){if(t.clipboardData.items.length===0){s.ElMessage.error(r.M2("复制文件到剪切板失败,请点击按钮上传!"));return}if(t.clipboardData.files.length>0){p.value=!0;for(let n=0;n<t.clipboardData.files.length;n++){t.clipboardData.files[n].size/1024/1024<100||s.ElMessage.error(r.M2("上传文件大小不能超过 100MB!"));const{name:w}=t.clipboardData.files[n];U.useUpload("115",t.clipboardData.files[n]).then(S=>{v.value={fileName:w||"",fileUrl:O.useFile({fileId:S[0]})}}).catch(()=>{})}}}},V=e.ref(null),N=()=>{V.value.scrollTo({top:0,behavior:"smooth"})},x=e.ref(0),E=e.ref(null);return e.onMounted(()=>{const t=document.getElementsByClassName("log-form")[0].clientHeight;x.value=window.innerHeight-t-E.value.offsetHeight-90,_()}),(t,n)=>(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(P,{ref:"logForm",class:"text-right log-form","project-id":t.projectId,onFilterChange:D},null,8,["project-id"]),e.createVNode(e.unref(s.ElScrollbar),{ref_key:"infiniteList",ref:V,class:"infinite-list-wrapper",style:e.normalizeStyle({height:x.value+"px"})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.List,o=>(e.openBlock(),e.createElementBlock("div",{key:o.Id,class:e.normalizeClass(l.LoginId==o.CreatedBy?"list-item-right":"list-item-left")},[l.LoginId==o.CreatedBy?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",null,[e.createElementVNode("div",H,[e.createElementVNode("div",Y,[e.createVNode(I,{id:l.LoginId,info:o},null,8,["id","info"])]),e.createVNode(e.unref(s.ElIcon),{color:"#f1f1f1",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.CaretRight))]),_:1})]),e.createElementVNode("div",z,e.toDisplayString(e.unref(M)(o.CreatedOnStr).format("YYYY-MM-DD HH: mm: ss")),1)]),e.createElementVNode("div",R,e.toDisplayString(o.CreatedName),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",A,e.toDisplayString(o.CreatedName),1),e.createElementVNode("div",null,[e.createElementVNode("div",K,[e.createVNode(e.unref(s.ElIcon),{color:"#ccc",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.CaretLeft))]),_:1}),e.createElementVNode("div",G,[e.createVNode(I,{id:l.LoginId,info:o},null,8,["id","info"])])]),e.createElementVNode("div",J,e.toDisplayString(e.unref(M)(o.CreatedOnStr).format("YYYY-MM-DD HH:mm:ss")),1)])],64))],2))),128)),e.createVNode(e.unref(T),{distance:10,onInfinite:_}),i.value?(e.openBlock(),e.createElementBlock("div",Q,e.toDisplayString(e.unref(r.M2)("加载中...")),1)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(e.unref(r.M2)("没有更多了!")),1)):e.createCommentVNode("",!0)]),_:1},8,["style"]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"logText",ref:E,"onUpdate:modelValue":n[0]||(n[0]=o=>c.value=o),class:"content-div",placeholder:e.unref(r.M2)("可通过 Ctrl+V 直接上传图片/文件"),contenteditable:"true",onPaste:q},null,40,W),[[e.vModelText,c.value]]),e.createElementVNode("div",X,[e.createVNode(F,{modelValue:d.value,"onUpdate:modelValue":n[1]||(n[1]=o=>d.value=o),"show-tips":!1,"show-list":!1,accept:".gif,.jpg,.png,.doc,.docx,.pdf,.xls,.xlsx,.ppt,.txt",onChange:L},null,8,["modelValue"]),e.createVNode(e.unref(s.ElButton),{type:"success",size:"small",class:"marginL6",onClick:n[2]||(n[2]=o=>B())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r.M2)("添加备注")),1)]),_:1})]),e.createVNode(b,{modelValue:p.value,"onUpdate:modelValue":n[3]||(n[3]=o=>p.value=o),"doc-info":v.value,onConfirmUpload:C},null,8,["modelValue","doc-info"])]))}});module.exports=Z;
|