mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 21:44:12 +08:00
Compare commits
2 Commits
2749a840ec
...
e69bc1821f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e69bc1821f | ||
![]() |
f95d182632 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
detect.gui/Embedded/dist/assets/drawer-3703d55d.css
vendored
Normal file
1
detect.gui/Embedded/dist/assets/drawer-3703d55d.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
detect.gui/Embedded/dist/assets/drawer-b4d140ea.js
vendored
Normal file
1
detect.gui/Embedded/dist/assets/drawer-b4d140ea.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
detect.gui/Embedded/dist/assets/index-992f6d15.css
vendored
Normal file
1
detect.gui/Embedded/dist/assets/index-992f6d15.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var x=(a,d)=>{var i={};for(var e in a)R.call(a,e)&&d.indexOf(e)<0&&(i[e]=a[e]);if(a!=null&&D)for(var e of D(a))d.indexOf(e)<0&&N.call(a,e)&&(i[e]=a[e]);return i};import{u as P,B as $}from"./useTable-e949a6b7.js";import{T as j}from"./useForm-baba730a.js";import{S as O,j as V,_ as A}from"./index.js";import{N as H,j as h}from"./antd-0679333d.js";import{r as z,s as E}from"./deviceApi-260fcde9.js";import{u as F}from"./index-679d8a0a.js";import{D as K,c as U,s as C}from"./drawer-8318451d.js";import{d as W,o as G,a6 as L,Z as S,_ as Z,$ as Y,k as p,u as c,a5 as b,l as q,G as J,a4 as Q,a8 as X}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const ee={class:"header"},te=W({__name:"index",setup(a){const[d,{openDrawer:i}]=F(),[e,{reload:v}]=P({api:t=>E(w(t)),columns:U,formConfig:{labelWidth:0,schemas:C,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:t=>t.id,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});G(()=>{WebViewService.setIsLoading(!1).then(()=>{})});const w=t=>{const g=t,{pageNum:n,pageSize:u,field:f="id",order:m="descend"}=g,I=x(g,["pageNum","pageSize","field","order"]),s={pageNum:n,pageSize:u,orderByClause:`${f} ${m==="descend"?"desc":"asc"}`};return Object.keys(I).forEach(_=>{const l=C.find(M=>M.field===_),o=t[_],r=_;l?o!==void 0&&o!==""&&(l.component==="Input"?s[r]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(l.component)?s[r]=V(o)?o.value:o:l.component==="RangePicker"?(s[`${r}From`]=h(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),s[`${r}To`]=h(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):l.component==="DatePicker"?s[r]=h(o).format(l.componentProps.format||"YYYY-MM-DD"):s[r]=o):s[r]=o}),s},y=()=>{i(!0,{isUpdate:!1})},T=t=>{i(!0,{record:t,isUpdate:!0})},k=t=>{z(t.id).then(n=>{v()})},B=()=>{v()};return(t,n)=>{const u=L("a-button");return S(),Z("div",null,[Y("div",ee,[p(c(O),{size:"19",name:"list"}),n[0]||(n[0]=Y("div",{class:"title"},"设备列表",-1))]),p(c($),{onRegister:c(e)},{toolbar:b(()=>[p(u,{type:"primary",onClick:y,icon:q(c(H))},{default:b(()=>n[1]||(n[1]=[J("新增")])),_:1},8,["icon"])]),bodyCell:b(({column:f,record:m})=>[f.dataIndex==="action"?(S(),Q(c(j),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:T.bind(null,m),divider:!0},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:k.bind(null,m),placement:"topRight"}}]},null,8,["actions"])):X("",!0)]),_:1},8,["onRegister"]),p(K,{onRegister:c(d),onSuccess:B},null,8,["onRegister"])])}}});const he=A(te,[["__scopeId","data-v-56d2e6a3"]]);export{he as default};
|
||||
var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var x=(a,d)=>{var i={};for(var e in a)R.call(a,e)&&d.indexOf(e)<0&&(i[e]=a[e]);if(a!=null&&D)for(var e of D(a))d.indexOf(e)<0&&N.call(a,e)&&(i[e]=a[e]);return i};import{u as P,B as $}from"./useTable-e949a6b7.js";import{T as j}from"./useForm-baba730a.js";import{S as O,j as V,_ as A}from"./index.js";import{N as H,j as h}from"./antd-0679333d.js";import{r as z,s as E}from"./deviceApi-260fcde9.js";import{u as F}from"./index-679d8a0a.js";import{D as K,c as U,s as C}from"./drawer-dcc643f2.js";import{d as W,o as G,a6 as L,Z as S,_ as Z,$ as Y,k as p,u as c,a5 as b,l as q,G as J,a4 as Q,a8 as X}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const ee={class:"header"},te=W({__name:"index",setup(a){const[d,{openDrawer:i}]=F(),[e,{reload:v}]=P({api:t=>E(w(t)),columns:U,formConfig:{labelWidth:0,schemas:C,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:t=>t.id,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});G(()=>{WebViewService.setIsLoading(!1).then(()=>{})});const w=t=>{const g=t,{pageNum:n,pageSize:u,field:f="id",order:m="descend"}=g,I=x(g,["pageNum","pageSize","field","order"]),s={pageNum:n,pageSize:u,orderByClause:`${f} ${m==="descend"?"desc":"asc"}`};return Object.keys(I).forEach(_=>{const l=C.find(M=>M.field===_),o=t[_],r=_;l?o!==void 0&&o!==""&&(l.component==="Input"?s[r]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(l.component)?s[r]=V(o)?o.value:o:l.component==="RangePicker"?(s[`${r}From`]=h(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),s[`${r}To`]=h(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):l.component==="DatePicker"?s[r]=h(o).format(l.componentProps.format||"YYYY-MM-DD"):s[r]=o):s[r]=o}),s},y=()=>{i(!0,{isUpdate:!1})},T=t=>{i(!0,{record:t,isUpdate:!0})},k=t=>{z(t.id).then(n=>{v()})},B=()=>{v()};return(t,n)=>{const u=L("a-button");return S(),Z("div",null,[Y("div",ee,[p(c(O),{size:"19",name:"list"}),n[0]||(n[0]=Y("div",{class:"title"},"设备列表",-1))]),p(c($),{onRegister:c(e)},{toolbar:b(()=>[p(u,{type:"primary",onClick:y,icon:q(c(H))},{default:b(()=>n[1]||(n[1]=[J("新增")])),_:1},8,["icon"])]),bodyCell:b(({column:f,record:m})=>[f.dataIndex==="action"?(S(),Q(c(j),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:T.bind(null,m),divider:!0},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:k.bind(null,m),placement:"topRight"}}]},null,8,["actions"])):X("",!0)]),_:1},8,["onRegister"]),p(K,{onRegister:c(d),onSuccess:B},null,8,["onRegister"])])}}});const he=A(te,[["__scopeId","data-v-56d2e6a3"]]);export{he as default};
|
@ -1 +1 @@
|
||||
import{k as _,B,b1 as T,u as y,a8 as l,_ as D}from"./index.js";import{c as d,u as L}from"./index-fb041426.js";import{aZ as P}from"./antd-0679333d.js";import{d as w,c as f,u as t,Z as s,_ as C,k as E,a4 as S,a8 as k,a1 as F,F as v,a6 as a}from"./vue-72a104e4.js";import"./index-263734bb.js";import"./index-0a75e8e4.js";import"./useContentViewHeight-1771cd5b.js";import"./useWindowSizeFn-1db11f4f.js";import"./lock-a170f962.js";const x=w({name:"LayoutFeatures",components:{BackTop:P,LayoutLockPage:d(()=>_(()=>import("./index-6c3f423b.js"),["./index-6c3f423b.js","./vue-72a104e4.js","./LockPage-1f0cbf71.js","./index.js","./antd-0679333d.js","./index-a17248e3.css","./lock-a170f962.js","./header-b90f4bbc.js","./LockPage-b0b08e00.css"],import.meta.url)),SettingDrawer:d(()=>_(()=>import("./index-ddf909b2.js").then(e=>e.i),["./index-ddf909b2.js","./index-679d8a0a.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-a17248e3.css","./index-ac2d527c.css","./index-fb041426.js","./index-263734bb.js","./index-0a75e8e4.js","./useContentViewHeight-1771cd5b.js","./useWindowSizeFn-1db11f4f.js","./index-054645fa.css","./lock-a170f962.js","./index-fffcad33.css"],import.meta.url))},setup(){const{getUseOpenBackTop:e,getShowSettingButton:i,getSettingButtonPosition:u,getFullContent:c}=B(),p=T(),{prefixCls:m}=y("setting-drawer-feature"),{getShowHeader:o}=L(),n=f(()=>p.getSessionTimeout),r=f(()=>{if(!t(i))return!1;const g=t(u);return g===l.AUTO?!t(o)||t(c):g===l.FIXED});return{getTarget:()=>document.body,getUseOpenBackTop:e,getIsFixedSettingDrawer:r,prefixCls:m,getIsSessionTimeout:n}}});function I(e,i,u,c,p,m){const o=a("LayoutLockPage"),n=a("BackTop"),r=a("SettingDrawer");return s(),C(v,null,[E(o),e.getUseOpenBackTop?(s(),S(n,{key:0,target:e.getTarget},null,8,["target"])):k("",!0),e.getIsFixedSettingDrawer?(s(),S(r,{key:1,class:F(e.prefixCls)},null,8,["class"])):k("",!0)],64)}const N=D(x,[["render",I]]);export{N as default};
|
||||
import{k as _,B,b1 as T,u as y,a8 as l,_ as D}from"./index.js";import{c as d,u as L}from"./index-fb041426.js";import{aZ as P}from"./antd-0679333d.js";import{d as w,c as f,u as t,Z as s,_ as C,k as E,a4 as S,a8 as k,a1 as F,F as v,a6 as a}from"./vue-72a104e4.js";import"./index-263734bb.js";import"./index-0a75e8e4.js";import"./useContentViewHeight-1771cd5b.js";import"./useWindowSizeFn-1db11f4f.js";import"./lock-a170f962.js";const x=w({name:"LayoutFeatures",components:{BackTop:P,LayoutLockPage:d(()=>_(()=>import("./index-6c3f423b.js"),["./index-6c3f423b.js","./vue-72a104e4.js","./LockPage-1f0cbf71.js","./index.js","./antd-0679333d.js","./index-6d9b3862.css","./lock-a170f962.js","./header-b90f4bbc.js","./LockPage-b0b08e00.css"],import.meta.url)),SettingDrawer:d(()=>_(()=>import("./index-ddf909b2.js").then(e=>e.i),["./index-ddf909b2.js","./index-679d8a0a.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-6d9b3862.css","./index-ac2d527c.css","./index-fb041426.js","./index-263734bb.js","./index-0a75e8e4.js","./useContentViewHeight-1771cd5b.js","./useWindowSizeFn-1db11f4f.js","./index-054645fa.css","./lock-a170f962.js","./index-fffcad33.css"],import.meta.url))},setup(){const{getUseOpenBackTop:e,getShowSettingButton:i,getSettingButtonPosition:u,getFullContent:c}=B(),p=T(),{prefixCls:m}=y("setting-drawer-feature"),{getShowHeader:o}=L(),n=f(()=>p.getSessionTimeout),r=f(()=>{if(!t(i))return!1;const g=t(u);return g===l.AUTO?!t(o)||t(c):g===l.FIXED});return{getTarget:()=>document.body,getUseOpenBackTop:e,getIsFixedSettingDrawer:r,prefixCls:m,getIsSessionTimeout:n}}});function I(e,i,u,c,p,m){const o=a("LayoutLockPage"),n=a("BackTop"),r=a("SettingDrawer");return s(),C(v,null,[E(o),e.getUseOpenBackTop?(s(),S(n,{key:0,target:e.getTarget},null,8,["target"])):k("",!0),e.getIsFixedSettingDrawer?(s(),S(r,{key:1,class:F(e.prefixCls)},null,8,["class"])):k("",!0)],64)}const N=D(x,[["render",I]]);export{N as default};
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{k as D,p as U,u as b,an as N,v as O,X as P,bc as S,_ as x}from"./index.js";import{D as A}from"./siteSetting-efd6ab5b.js";import{c as v,u as E}from"./index-fb041426.js";import{u as R}from"./index-8a6826ba.js";import{h as V}from"./header-b90f4bbc.js";import{D as B,q as L}from"./antd-0679333d.js";import{d as T,c as F,Z as l,_ as q,k as t,a5 as g,F as z,a6 as n,a4 as k,a8 as _,$ as a,a1 as s,a0 as I}from"./vue-72a104e4.js";import"./index-263734bb.js";import"./index-0a75e8e4.js";import"./useContentViewHeight-1771cd5b.js";import"./useWindowSizeFn-1db11f4f.js";import"./lock-a170f962.js";const H=T({name:"UserDropdown",components:{Dropdown:B,Menu:L,MenuItem:v(()=>D(()=>import("./DropMenuItem-91227dd6.js"),["./DropMenuItem-91227dd6.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-a17248e3.css"],import.meta.url)),MenuDivider:L.Divider,LockAction:v(()=>D(()=>import("./LockModal-dca74201.js"),["./LockModal-dca74201.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-a17248e3.css","./index-8a6826ba.js","./useWindowSizeFn-1db11f4f.js","./index-7064e331.css","./useForm-baba730a.js","./copyTextToClipboard-3ca69a78.js","./useForm-01d9c31d.css","./lock-a170f962.js","./header-b90f4bbc.js","./LockModal-ca58db68.css"],import.meta.url))},props:{theme:U.oneOf(["dark","light"])},setup(){const{prefixCls:e}=b("header-user-dropdown"),{t:h}=O(),{getShowDoc:C,getUseLockPage:w}=E(),c=N(),y=F(()=>{const{realName:f="",avatar:M,tenant:$}=c.getUserInfo||{};return{realName:f,avatar:M||V,desc:"",tenant:$}}),[o,{openModal:p}]=R();function u(){p(!0)}function d(){c.confirmLoginOut()}function m(){P(A)}function r(){S.push("/change-password")}function i(f){switch(f.key){case"password":r();break;case"logout":d();break;case"doc":m();break;case"lock":u();break}}return{prefixCls:e,t:h,getUserInfo:y,handleMenuClick:i,getShowDoc:C,register:o,getUseLockPage:w}}});const W=["src"];function X(e,h,C,w,c,y){const o=n("MenuItem"),p=n("MenuDivider"),u=n("Menu"),d=n("Dropdown"),m=n("LockAction");return l(),q(z,null,[t(d,{placement:"bottomLeft",overlayClassName:`${e.prefixCls}-dropdown-overlay`},{overlay:g(()=>[t(u,{onClick:e.handleMenuClick},{default:g(()=>[e.getShowDoc?(l(),k(o,{key:"doc",text:e.t("layout.header.dropdownItemDoc"),icon:"ion:document-text-outline"},null,8,["text"])):_("",!0),e.getShowDoc?(l(),k(p,{key:1})):_("",!0),e.getUseLockPage?(l(),k(o,{key:"lock",text:e.t("layout.header.tooltipLock"),icon:"ion:lock-closed-outline"},null,8,["text"])):_("",!0),t(o,{key:"password",text:e.t("layout.header.tooltipChangePassword"),icon:"ion:document-lock-outline"},null,8,["text"]),t(o,{key:"logout",text:e.t("layout.header.dropdownItemLoginOut"),icon:"ion:power-outline"},null,8,["text"])]),_:1},8,["onClick"])]),default:g(()=>{var r,i;return[a("span",{class:s([[e.prefixCls,`${e.prefixCls}--${e.theme}`],"flex"])},[a("span",{style:{"margin-right":"10px"},class:s(`${e.prefixCls}__name`)},I((i=(r=e.getUserInfo.tenant)==null?void 0:r.productList)==null?void 0:i[0].name),3),a("img",{class:s(`${e.prefixCls}__header`),src:e.getUserInfo.avatar},null,10,W),a("span",{class:s(`${e.prefixCls}__info hidden md:block`)},[a("span",{class:s([`${e.prefixCls}__name`,"truncate"])},I(e.getUserInfo.realName),3)],2)],2)]}),_:1},8,["overlayClassName"]),t(m,{onRegister:e.register},null,8,["onRegister"])],64)}const se=x(H,[["render",X]]);export{se as default};
|
||||
import{k as D,p as U,u as b,an as N,v as O,X as P,bc as S,_ as x}from"./index.js";import{D as A}from"./siteSetting-efd6ab5b.js";import{c as v,u as E}from"./index-fb041426.js";import{u as R}from"./index-8a6826ba.js";import{h as V}from"./header-b90f4bbc.js";import{D as B,q as L}from"./antd-0679333d.js";import{d as T,c as F,Z as l,_ as q,k as t,a5 as g,F as z,a6 as n,a4 as k,a8 as _,$ as a,a1 as s,a0 as I}from"./vue-72a104e4.js";import"./index-263734bb.js";import"./index-0a75e8e4.js";import"./useContentViewHeight-1771cd5b.js";import"./useWindowSizeFn-1db11f4f.js";import"./lock-a170f962.js";const H=T({name:"UserDropdown",components:{Dropdown:B,Menu:L,MenuItem:v(()=>D(()=>import("./DropMenuItem-91227dd6.js"),["./DropMenuItem-91227dd6.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-6d9b3862.css"],import.meta.url)),MenuDivider:L.Divider,LockAction:v(()=>D(()=>import("./LockModal-dca74201.js"),["./LockModal-dca74201.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-6d9b3862.css","./index-8a6826ba.js","./useWindowSizeFn-1db11f4f.js","./index-7064e331.css","./useForm-baba730a.js","./copyTextToClipboard-3ca69a78.js","./useForm-01d9c31d.css","./lock-a170f962.js","./header-b90f4bbc.js","./LockModal-ca58db68.css"],import.meta.url))},props:{theme:U.oneOf(["dark","light"])},setup(){const{prefixCls:e}=b("header-user-dropdown"),{t:h}=O(),{getShowDoc:C,getUseLockPage:w}=E(),c=N(),y=F(()=>{const{realName:f="",avatar:M,tenant:$}=c.getUserInfo||{};return{realName:f,avatar:M||V,desc:"",tenant:$}}),[o,{openModal:p}]=R();function u(){p(!0)}function d(){c.confirmLoginOut()}function m(){P(A)}function r(){S.push("/change-password")}function i(f){switch(f.key){case"password":r();break;case"logout":d();break;case"doc":m();break;case"lock":u();break}}return{prefixCls:e,t:h,getUserInfo:y,handleMenuClick:i,getShowDoc:C,register:o,getUseLockPage:w}}});const W=["src"];function X(e,h,C,w,c,y){const o=n("MenuItem"),p=n("MenuDivider"),u=n("Menu"),d=n("Dropdown"),m=n("LockAction");return l(),q(z,null,[t(d,{placement:"bottomLeft",overlayClassName:`${e.prefixCls}-dropdown-overlay`},{overlay:g(()=>[t(u,{onClick:e.handleMenuClick},{default:g(()=>[e.getShowDoc?(l(),k(o,{key:"doc",text:e.t("layout.header.dropdownItemDoc"),icon:"ion:document-text-outline"},null,8,["text"])):_("",!0),e.getShowDoc?(l(),k(p,{key:1})):_("",!0),e.getUseLockPage?(l(),k(o,{key:"lock",text:e.t("layout.header.tooltipLock"),icon:"ion:lock-closed-outline"},null,8,["text"])):_("",!0),t(o,{key:"password",text:e.t("layout.header.tooltipChangePassword"),icon:"ion:document-lock-outline"},null,8,["text"]),t(o,{key:"logout",text:e.t("layout.header.dropdownItemLoginOut"),icon:"ion:power-outline"},null,8,["text"])]),_:1},8,["onClick"])]),default:g(()=>{var r,i;return[a("span",{class:s([[e.prefixCls,`${e.prefixCls}--${e.theme}`],"flex"])},[a("span",{style:{"margin-right":"10px"},class:s(`${e.prefixCls}__name`)},I((i=(r=e.getUserInfo.tenant)==null?void 0:r.productList)==null?void 0:i[0].name),3),a("img",{class:s(`${e.prefixCls}__header`),src:e.getUserInfo.avatar},null,10,W),a("span",{class:s(`${e.prefixCls}__info hidden md:block`)},[a("span",{class:s([`${e.prefixCls}__name`,"truncate"])},I(e.getUserInfo.realName),3)],2)],2)]}),_:1},8,["overlayClassName"]),t(m,{onRegister:e.register},null,8,["onRegister"])],64)}const se=x(H,[["render",X]]);export{se as default};
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
detect.gui/Embedded/dist/assets/index-f49f6173.js
vendored
Normal file
12
detect.gui/Embedded/dist/assets/index-f49f6173.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{B as g,u as v}from"./useTable-e949a6b7.js";import{T as C}from"./useForm-baba730a.js";import{S as w,r as S,q as T,s as B,_ as R}from"./index.js";import{u as k}from"./index-679d8a0a.js";import{R as D,c as y,s as I}from"./drawer-c24723db.js";import{d as $,l as A,o as E,a6 as a,Z as _,_ as F,$ as h,k as r,a5 as m,G as N,a4 as V,a8 as x}from"./vue-72a104e4.js";import{N as M}from"./antd-0679333d.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";import"./authorityApi-b12c1221.js";const P=$({name:"UserPage",methods:{PlusOutlined:M,h:A},components:{SvgIcon:w,BasicTable:g,RoleDrawer:D,TableAction:C},setup(){const{createMessage:e}=T(),[o,{openDrawer:i}]=k(),[p,{reload:l}]=v({api:B,columns:y,formConfig:{labelWidth:0,schemas:I,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,pagination:!1,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});function f(){i(!0,{isUpdate:!1})}function c(n){i(!0,{record:n,isUpdate:!0})}function d(n){S(n.id).then(t=>{e.success("删除用户成功!"),l()},t=>{e.error(`删除用户失败:${t}`)})}function u(){l()}return E(()=>{WebViewService.setIsLoading(!1).then(()=>{})}),{registerTable:p,registerDrawer:o,handleCreate:f,handleEdit:c,handleDelete:d,handleSuccess:u}}});const U={class:"header"};function z(e,o,i,p,l,f){const c=a("SvgIcon"),d=a("a-button"),u=a("TableAction"),n=a("BasicTable"),t=a("RoleDrawer");return _(),F("div",null,[h("div",U,[r(c,{size:"19",name:"list"}),o[0]||(o[0]=h("div",{class:"title"},"用户列表",-1))]),r(n,{onRegister:e.registerTable},{toolbar:m(()=>[r(d,{type:"primary",onClick:e.handleCreate,icon:e.h(e.PlusOutlined)},{default:m(()=>o[1]||(o[1]=[N("新 增")])),_:1},8,["onClick","icon"])]),bodyCell:m(({column:b,record:s})=>[b.key==="action"?(_(),V(u,{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,s),divider:!0,disabled:s.username==="admin"},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:e.handleDelete.bind(null,s),placement:"topRight"},disabled:s.username==="admin"}]},null,8,["actions"])):x("",!0)]),_:1},8,["onRegister"]),r(t,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const ee=R(P,[["render",z],["__scopeId","data-v-90dcdd60"]]);export{ee as default};
|
||||
import{B as g,u as v}from"./useTable-e949a6b7.js";import{T as C}from"./useForm-baba730a.js";import{S as w,r as S,q as T,s as B,_ as R}from"./index.js";import{u as k}from"./index-679d8a0a.js";import{R as D,c as y,s as I}from"./drawer-b1df0d5f.js";import{d as $,l as A,o as E,a6 as a,Z as _,_ as F,$ as h,k as r,a5 as m,G as N,a4 as V,a8 as x}from"./vue-72a104e4.js";import{N as M}from"./antd-0679333d.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";import"./authorityApi-b12c1221.js";const P=$({name:"UserPage",methods:{PlusOutlined:M,h:A},components:{SvgIcon:w,BasicTable:g,RoleDrawer:D,TableAction:C},setup(){const{createMessage:e}=T(),[o,{openDrawer:i}]=k(),[p,{reload:l}]=v({api:B,columns:y,formConfig:{labelWidth:0,schemas:I,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,pagination:!1,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});function f(){i(!0,{isUpdate:!1})}function c(n){i(!0,{record:n,isUpdate:!0})}function d(n){S(n.id).then(t=>{e.success("删除用户成功!"),l()},t=>{e.error(`删除用户失败:${t}`)})}function u(){l()}return E(()=>{WebViewService.setIsLoading(!1).then(()=>{})}),{registerTable:p,registerDrawer:o,handleCreate:f,handleEdit:c,handleDelete:d,handleSuccess:u}}});const U={class:"header"};function z(e,o,i,p,l,f){const c=a("SvgIcon"),d=a("a-button"),u=a("TableAction"),n=a("BasicTable"),t=a("RoleDrawer");return _(),F("div",null,[h("div",U,[r(c,{size:"19",name:"list"}),o[0]||(o[0]=h("div",{class:"title"},"用户列表",-1))]),r(n,{onRegister:e.registerTable},{toolbar:m(()=>[r(d,{type:"primary",onClick:e.handleCreate,icon:e.h(e.PlusOutlined)},{default:m(()=>o[1]||(o[1]=[N("新 增")])),_:1},8,["onClick","icon"])]),bodyCell:m(({column:b,record:s})=>[b.key==="action"?(_(),V(u,{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,s),divider:!0,disabled:s.username==="admin"},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:e.handleDelete.bind(null,s),placement:"topRight"},disabled:s.username==="admin"}]},null,8,["actions"])):x("",!0)]),_:1},8,["onRegister"]),r(t,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const ee=R(P,[["render",z],["__scopeId","data-v-90dcdd60"]]);export{ee as default};
|
File diff suppressed because one or more lines are too long
6
detect.gui/Embedded/dist/assets/index.js
vendored
6
detect.gui/Embedded/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
1
detect.gui/Embedded/dist/assets/modal-2de68995.js
vendored
Normal file
1
detect.gui/Embedded/dist/assets/modal-2de68995.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var B=Object.defineProperty;var c=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var _=(o,l,e)=>l in o?B(o,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[l]=e,u=(o,l)=>{for(var e in l||(l={}))h.call(l,e)&&_(o,e,l[e]);if(c)for(var e of c(l))b.call(l,e)&&_(o,e,l[e]);return o};var P=(o,l)=>{var e={};for(var s in o)h.call(o,s)&&l.indexOf(s)<0&&(e[s]=o[s]);if(o!=null&&c)for(var s of c(o))l.indexOf(s)<0&&b.call(o,s)&&(e[s]=o[s]);return e};var f=(o,l,e)=>new Promise((s,p)=>{var i=r=>{try{n(e.next(r))}catch(m){p(m)}},d=r=>{try{n(e.throw(r))}catch(m){p(m)}},n=r=>r.done?s(r.value):Promise.resolve(r.value).then(i,d);n((e=e.apply(o,l)).next())});import{a as x,B as F}from"./index-8a6826ba.js";import{u as M,B as k}from"./useForm-baba730a.js";import{d as R,f as v,c as W,u as t,Z as H,a4 as L,a5 as X,k as Y,a9 as O}from"./vue-72a104e4.js";import{_ as S}from"./index.js";import"./antd-0679333d.js";import"./useWindowSizeFn-1db11f4f.js";import"./copyTextToClipboard-3ca69a78.js";const U=R({__name:"modal",emits:["success","register"],setup(o,{emit:l}){const e=v(),s=v(!0),p=l,i=W(()=>t(s)?"编辑":"新增"),[d,{closeModal:n,setModalProps:r}]=x(a=>f(this,null,function*(){yield C(),r({confirmLoading:!1}),s.value=!!(a!=null&&a.isUpdate),e.value=a==null?void 0:a.record,yield I(u({},a.record))})),m=[{colProps:{span:24},field:"sn",label:"序号",componentProps:{allowClear:!1,placeholder:"序号"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入序号!"}]},{colProps:{span:24},field:"code",label:"预埋件编号",componentProps:{allowClear:!1,placeholder:"预埋件编号"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入预埋件编号!"}]},{colProps:{span:24},field:"type",label:"类型",componentProps:{allowClear:!1,placeholder:"类型"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入类型!"}]},{colProps:{span:24},field:"x",label:"X(mm)",componentProps:{allowClear:!1,placeholder:"X(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入X(mm)!"}]},{colProps:{span:24},field:"y",label:"Y(mm)",componentProps:{allowClear:!1,placeholder:"Y(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入Y(mm)!"}]},{colProps:{span:24},field:"w",label:"W(mm)",componentProps:{allowClear:!1,placeholder:"W(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入W(mm)!"}]},{colProps:{span:24},field:"h",label:"H(mm)",componentProps:{allowClear:!1,placeholder:"H(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入H(mm)!"}]},{colProps:{span:24},field:"center",label:"Center(m)",componentProps:{allowClear:!1,placeholder:"Center(m)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入Center(m)!"}]}],[w,{resetFields:C,setFieldsValue:I,validate:V}]=M({labelWidth:90,schemas:m,showActionButtonGroup:!1});function y(){return f(this,null,function*(){try{const a=yield V();r({confirmLoading:!0});const g=P(a,[]);n();const q=Object.assign({},u(u({},t(e)),g));p("success",q)}catch(a){}finally{r({confirmLoading:!1})}})}return(a,g)=>(H(),L(t(F),O(a.$attrs,{onRegister:t(d),closable:!1,showFooter:"",title:i.value,width:"400px",onOk:y}),{default:X(()=>[Y(t(k),{onRegister:t(w)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const D=S(U,[["__scopeId","data-v-934beb3b"]]);export{D as default};
|
@ -1 +0,0 @@
|
||||
var B=Object.defineProperty;var p=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var g=(o,l,e)=>l in o?B(o,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[l]=e,i=(o,l)=>{for(var e in l||(l={}))h.call(l,e)&&g(o,e,l[e]);if(p)for(var e of p(l))P.call(l,e)&&g(o,e,l[e]);return o};var v=(o,l)=>{var e={};for(var s in o)h.call(o,s)&&l.indexOf(s)<0&&(e[s]=o[s]);if(o!=null&&p)for(var s of p(o))l.indexOf(s)<0&&P.call(o,s)&&(e[s]=o[s]);return e};var f=(o,l,e)=>new Promise((s,m)=>{var u=r=>{try{n(e.next(r))}catch(c){m(c)}},d=r=>{try{n(e.throw(r))}catch(c){m(c)}},n=r=>r.done?s(r.value):Promise.resolve(r.value).then(u,d);n((e=e.apply(o,l)).next())});import{a as x,B as F}from"./index-8a6826ba.js";import{u as M,B as k}from"./useForm-baba730a.js";import{d as R,f as w,c as W,u as t,Z as H,a4 as L,a5 as X,k as Y,a9 as O}from"./vue-72a104e4.js";import{_ as S}from"./index.js";import"./antd-0679333d.js";import"./useWindowSizeFn-1db11f4f.js";import"./copyTextToClipboard-3ca69a78.js";const U=R({__name:"modal",emits:["success","register"],setup(o,{emit:l}){const e=w(),s=w(!0),m=l,u=W(()=>t(s)?"编辑":"新增"),[d,{closeModal:n,setModalProps:r}]=x(a=>f(this,null,function*(){yield b(),r({confirmLoading:!1}),s.value=!!(a!=null&&a.isUpdate),e.value=a==null?void 0:a.record,yield y(i({},a.record))})),c=[{colProps:{span:24},field:"code",label:"预埋件编号",componentProps:{allowClear:!1,placeholder:"预埋件编号"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入预埋件编号!"}]},{colProps:{span:24},field:"type",label:"类型",componentProps:{allowClear:!1,placeholder:"类型"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入类型!"}]},{colProps:{span:24},field:"x",label:"X(mm)",componentProps:{allowClear:!1,placeholder:"X(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入X(mm)!"}]},{colProps:{span:24},field:"y",label:"Y(mm)",componentProps:{allowClear:!1,placeholder:"Y(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入Y(mm)!"}]},{colProps:{span:24},field:"w",label:"W(mm)",componentProps:{allowClear:!1,placeholder:"W(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入W(mm)!"}]},{colProps:{span:24},field:"h",label:"H(mm)",componentProps:{allowClear:!1,placeholder:"H(mm)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入H(mm)!"}]},{colProps:{span:24},field:"center",label:"Center(m)",componentProps:{allowClear:!1,placeholder:"Center(m)"},component:"Input",defaultValue:void 0,rules:[{required:!0,message:"请输入Center(m)!"}]}],[C,{resetFields:b,setFieldsValue:y,validate:I}]=M({labelWidth:90,schemas:c,showActionButtonGroup:!1});function V(){return f(this,null,function*(){try{const a=yield I();r({confirmLoading:!0});const _=v(a,[]);n();const q=Object.assign({},i(i({},t(e)),_));m("success",q)}catch(a){}finally{r({confirmLoading:!1})}})}return(a,_)=>(H(),L(t(F),O(a.$attrs,{onRegister:t(d),closable:!1,showFooter:"",title:u.value,width:"400px",onOk:V}),{default:X(()=>[Y(t(k),{onRegister:t(C)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const D=S(U,[["__scopeId","data-v-c3887645"]]);export{D as default};
|
1
detect.gui/Embedded/dist/assets/modal-8c2e4a79.css
vendored
Normal file
1
detect.gui/Embedded/dist/assets/modal-8c2e4a79.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
detect.gui/Embedded/dist/assets/result-ff3bfeb1.css
vendored
Normal file
1
detect.gui/Embedded/dist/assets/result-ff3bfeb1.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
detect.gui/Embedded/dist/index.html
vendored
2
detect.gui/Embedded/dist/index.html
vendored
@ -1 +1 @@
|
||||
<!doctype html><html lang="en" id="htmlRoot"><head><script crossorigin src="./_app.config.js"></script><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="renderer" content="webkit"/><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0"/><title>中核集团预埋件检测系统</title><link rel="icon" href="./favicon.ico"/><style>#app{background-color:#0d1540}</style><script type="module" crossorigin src="./assets/index.js"></script><link rel="modulepreload" crossorigin href="./assets/vue-72a104e4.js"><link rel="modulepreload" crossorigin href="./assets/antd-0679333d.js"><link rel="stylesheet" href="./assets/index-a17248e3.css"></head><body><div id="app"><style>html[data-theme=dark] .app-loading{background-color:transparent}html[data-theme=dark] .app-loading .app-loading-title{color:transparent}.app-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;background-color:transparent}.app-loading .app-loading-wrap{display:flex;position:absolute;top:50%;left:50%;flex-direction:column;align-items:center;justify-content:center;transform:translate3d(-50%,-50%,0)}.app-loading .dots{display:flex;align-items:center;justify-content:center;padding:98px}.app-loading .app-loading-title{display:flex;align-items:center;justify-content:center;margin-top:30px;color:rgb(0 0 0 / 85%);font-size:30px}.app-loading .app-loading-logo{display:block;width:90px;margin:0 auto;margin-bottom:20px}.dot{display:inline-block;position:relative;box-sizing:border-box;width:48px;height:48px;margin-top:30px;transform:rotate(45deg);animation:ant-rotate 1.2s infinite linear;font-size:32px}.dot i{display:block;position:absolute;width:20px;height:20px;transform:scale(.75);transform-origin:50% 50%;animation:ant-spin-move 1s infinite linear alternate;border-radius:100%;opacity:.3;background-color:#0065cc}.dot i:first-child{top:0;left:0}.dot i:nth-child(2){top:0;right:0;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;animation-delay:1.2s}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-spin-move{to{opacity:1}}@keyframes ant-spin-move{to{opacity:1}}</style><div class="app-loading"><div class="app-loading-wrap"></div></div></div></body></html>
|
||||
<!doctype html><html lang="en" id="htmlRoot"><head><script crossorigin src="./_app.config.js"></script><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="renderer" content="webkit"/><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0"/><title>中核集团预埋件检测系统</title><link rel="icon" href="./favicon.ico"/><style>#app{background-color:#0d1540}</style><script type="module" crossorigin src="./assets/index.js"></script><link rel="modulepreload" crossorigin href="./assets/vue-72a104e4.js"><link rel="modulepreload" crossorigin href="./assets/antd-0679333d.js"><link rel="stylesheet" href="./assets/index-6d9b3862.css"></head><body><div id="app"><style>html[data-theme=dark] .app-loading{background-color:transparent}html[data-theme=dark] .app-loading .app-loading-title{color:transparent}.app-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;background-color:transparent}.app-loading .app-loading-wrap{display:flex;position:absolute;top:50%;left:50%;flex-direction:column;align-items:center;justify-content:center;transform:translate3d(-50%,-50%,0)}.app-loading .dots{display:flex;align-items:center;justify-content:center;padding:98px}.app-loading .app-loading-title{display:flex;align-items:center;justify-content:center;margin-top:30px;color:rgb(0 0 0 / 85%);font-size:30px}.app-loading .app-loading-logo{display:block;width:90px;margin:0 auto;margin-bottom:20px}.dot{display:inline-block;position:relative;box-sizing:border-box;width:48px;height:48px;margin-top:30px;transform:rotate(45deg);animation:ant-rotate 1.2s infinite linear;font-size:32px}.dot i{display:block;position:absolute;width:20px;height:20px;transform:scale(.75);transform-origin:50% 50%;animation:ant-spin-move 1s infinite linear alternate;border-radius:100%;opacity:.3;background-color:#0065cc}.dot i:first-child{top:0;left:0}.dot i:nth-child(2){top:0;right:0;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;animation-delay:1.2s}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-spin-move{to{opacity:1}}@keyframes ant-spin-move{to{opacity:1}}</style><div class="app-loading"><div class="app-loading-wrap"></div></div></div></body></html>
|
@ -9,9 +9,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Text.Unicode;
|
||||
using System.Threading.Tasks;
|
||||
using detect.gui.Models;
|
||||
using detect.gui.VWMS;
|
||||
using PaddleOCRSharp;
|
||||
using Splat;
|
||||
|
||||
namespace detect.gui.Services;
|
||||
|
||||
@ -86,13 +84,16 @@ public class OCRService
|
||||
return new ApiResponse<string?>(0, "success", result);
|
||||
}
|
||||
|
||||
public Task<string> ImportByOCR(string base64ImageString, string? wallCode)
|
||||
public Task<string> ImportByOCR(string base64ImageString)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
fileName = GetImage(base64ImageString, fileName);
|
||||
var result = _engine?.DetectText(new Bitmap(fileName));
|
||||
// var fileName = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
// fileName = GetImage(base64ImageString, fileName);
|
||||
// var result = _engine?.DetectText(new Bitmap(fileName));
|
||||
var image = GetImage(base64ImageString);
|
||||
if (image is null) return "";
|
||||
var result = _engine?.DetectText(image);
|
||||
if (result == null) return "";
|
||||
var resultList = JsonHelper.DeserializeObject<List<OCRResultEntity>>(result.JsonText);
|
||||
resultList = resultList.Select((d, index) =>
|
||||
@ -100,29 +101,49 @@ public class OCRService
|
||||
d.Index = index;
|
||||
return d;
|
||||
}).ToList();
|
||||
var items = resultList.Where(d => !string.IsNullOrEmpty(d.Text) && d.Text.ToUpper().Contains("定位信息表")).ToList();
|
||||
if (items.Any() && !string.IsNullOrEmpty(items.First().Text))
|
||||
{
|
||||
wallCode = items.First().Text!.Replace("定位信息表", "").Replace("预埋件", "").Replace("墙", "");
|
||||
}
|
||||
// var tempList = resultList.Where(d => !string.IsNullOrEmpty(d.Text) &&
|
||||
// (d.Text.ToUpper().Contains("PT") ||
|
||||
// d.Text.ToUpper().Contains("VBP") ||
|
||||
// d.Text.ToUpper().Contains("BSC")))
|
||||
// .ToList();
|
||||
var tempList = new List<OCRResultEntity>();
|
||||
if (wallCode != null)
|
||||
{
|
||||
tempList = resultList.Where(d => !string.IsNullOrEmpty(d.Text) && d.Text.ToUpper().Contains(wallCode.ToUpper())).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
tempList = resultList.Where(d => !string.IsNullOrEmpty(d.Text) &&
|
||||
(d.Text.ToUpper().Contains("P") ||
|
||||
d.Text.ToUpper().Contains("VB") ||
|
||||
d.Text.ToUpper().Contains("BS")))
|
||||
.ToList();
|
||||
}
|
||||
// var items = resultList.Where(d => !string.IsNullOrEmpty(d.Text) && d.Text.ToUpper().Contains("定位信息表")).ToList();
|
||||
// if (items.Any() && !string.IsNullOrEmpty(items.First().Text))
|
||||
// {
|
||||
// wallCode = items.First().Text!.Replace("定位信息表", "").Replace("预埋件", "").Replace("墙", "");
|
||||
// }
|
||||
// var tempList = new List<OCRResultEntity>();
|
||||
// if (!string.IsNullOrWhiteSpace(wallCode))
|
||||
// {
|
||||
// tempList = resultList.Where(d => !string.IsNullOrEmpty(d.Text) && d.Text.ToUpper().Contains(wallCode.ToUpper())).ToList();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
var tempList = resultList.Where(d => !string.IsNullOrEmpty(d.Text) &&
|
||||
(d.Text.ToUpper().Contains("PA") ||
|
||||
d.Text.ToUpper().Contains("PB") ||
|
||||
d.Text.ToUpper().Contains("PC") ||
|
||||
d.Text.ToUpper().Contains("PD") ||
|
||||
d.Text.ToUpper().Contains("PE") ||
|
||||
d.Text.ToUpper().Contains("PF") ||
|
||||
d.Text.ToUpper().Contains("PG") ||
|
||||
d.Text.ToUpper().Contains("PH") ||
|
||||
d.Text.ToUpper().Contains("PI") ||
|
||||
d.Text.ToUpper().Contains("PJ") ||
|
||||
d.Text.ToUpper().Contains("PK") ||
|
||||
d.Text.ToUpper().Contains("PL") ||
|
||||
d.Text.ToUpper().Contains("PM") ||
|
||||
d.Text.ToUpper().Contains("PN") ||
|
||||
d.Text.ToUpper().Contains("PO") ||
|
||||
d.Text.ToUpper().Contains("PP") ||
|
||||
d.Text.ToUpper().Contains("PO") ||
|
||||
d.Text.ToUpper().Contains("PR") ||
|
||||
d.Text.ToUpper().Contains("PS") ||
|
||||
d.Text.ToUpper().Contains("PT") ||
|
||||
d.Text.ToUpper().Contains("PU") ||
|
||||
d.Text.ToUpper().Contains("PV") ||
|
||||
d.Text.ToUpper().Contains("PW") ||
|
||||
d.Text.ToUpper().Contains("PX") ||
|
||||
d.Text.ToUpper().Contains("PY") ||
|
||||
d.Text.ToUpper().Contains("PZ") ||
|
||||
d.Text.ToUpper().Contains("VB") ||
|
||||
d.Text.ToUpper().Contains("BS")))
|
||||
.ToList();
|
||||
// }
|
||||
var data = new List<dynamic>();
|
||||
foreach (var item in tempList)
|
||||
{
|
||||
@ -149,8 +170,14 @@ public class OCRService
|
||||
h = type;
|
||||
}
|
||||
}
|
||||
else if (type.Contains('x', StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
w = type.Split("x")[0];
|
||||
h = type.Split("x")[1];
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -159,6 +186,7 @@ public class OCRService
|
||||
// }
|
||||
data.Add(new
|
||||
{
|
||||
sn = ReplaceChars(resultList[item.Index - 1].Text),
|
||||
code = ReplaceChars(resultList[item.Index].Text),
|
||||
type = ReplaceChars(resultList[item.Index + 1].Text),
|
||||
x = ReplaceChars(resultList[item.Index + 2].Text),
|
||||
@ -173,20 +201,21 @@ public class OCRService
|
||||
}
|
||||
catch
|
||||
{
|
||||
data.Add(new
|
||||
{
|
||||
code = "",
|
||||
type = "",
|
||||
x = "0",
|
||||
y = "0",
|
||||
center = "0",
|
||||
w = "0",
|
||||
h = "0",
|
||||
angle = "0",
|
||||
});
|
||||
// data.Add(new
|
||||
// {
|
||||
// sn = "",
|
||||
// code = "",
|
||||
// type = "",
|
||||
// x = "0",
|
||||
// y = "0",
|
||||
// center = "0",
|
||||
// w = "0",
|
||||
// h = "0",
|
||||
// angle = "0",
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return data.Count > 0
|
||||
? JsonSerializer.Serialize(data,
|
||||
new JsonSerializerOptions
|
||||
@ -200,33 +229,33 @@ public class OCRService
|
||||
return string.IsNullOrEmpty(text) ? "" : text.Replace("\u00d7", "x").Replace("_", "").Replace(",", "").Replace(":", "").Replace(";", "").Replace(" ", "").Replace(",", "");
|
||||
}
|
||||
|
||||
private string GetImage(string base64ImageString, string fileName)
|
||||
private Image? GetImage(string base64ImageString)
|
||||
{
|
||||
var imageType = System.Drawing.Imaging.ImageFormat.Gif;
|
||||
if (base64ImageString.IndexOf("data:image/jpeg", StringComparison.Ordinal) >= 0)
|
||||
{
|
||||
imageType = System.Drawing.Imaging.ImageFormat.Jpeg;
|
||||
base64ImageString = base64ImageString.Replace("data:image/jpeg;base64,", "");
|
||||
fileName += ".jpg";
|
||||
// fileName += ".jpg";
|
||||
}
|
||||
|
||||
if (base64ImageString.IndexOf("data:image/png", StringComparison.Ordinal) >= 0)
|
||||
{
|
||||
imageType = System.Drawing.Imaging.ImageFormat.Png;
|
||||
base64ImageString = base64ImageString.Replace("data:image/png;base64,", "");
|
||||
fileName += ".png";
|
||||
// fileName += ".png";
|
||||
}
|
||||
|
||||
if (base64ImageString.IndexOf("data:image/bmp", StringComparison.Ordinal) >= 0)
|
||||
{
|
||||
imageType = System.Drawing.Imaging.ImageFormat.Bmp;
|
||||
base64ImageString = base64ImageString.Replace("data:image/bmp;base64,", "");
|
||||
fileName += ".bmp";
|
||||
// fileName += ".bmp";
|
||||
}
|
||||
|
||||
if (Equals(imageType, System.Drawing.Imaging.ImageFormat.Gif))
|
||||
{
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
@ -234,19 +263,18 @@ public class OCRService
|
||||
var imageBytes = Convert.FromBase64String(base64ImageString.Replace("data:image/jpeg;base64,", ""));
|
||||
using var ms = new MemoryStream(imageBytes);
|
||||
var image = System.Drawing.Image.FromStream(ms);
|
||||
using (var bmpStream = new MemoryStream())
|
||||
{
|
||||
image.Save(bmpStream, imageType);
|
||||
var bmpBytes = bmpStream.ToArray();
|
||||
File.WriteAllBytes(fileName, bmpBytes);
|
||||
}
|
||||
using var bmpStream = new MemoryStream();
|
||||
image.Save(bmpStream, imageType);
|
||||
// var bmpBytes = bmpStream.ToArray();
|
||||
// File.WriteAllBytes(fileName, bmpBytes);
|
||||
|
||||
image.Dispose();
|
||||
return fileName;
|
||||
return image;
|
||||
// image.Dispose();
|
||||
// return fileName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,17 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
using System.Text.Unicode;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Threading;
|
||||
using detect.gui.VWMS;
|
||||
using detect.gui.VWS;
|
||||
using OfficeOpenXml;
|
||||
using Splat;
|
||||
using WebViewControl;
|
||||
|
||||
@ -21,55 +13,55 @@ public class WebViewService(MainWindow? w)
|
||||
{
|
||||
public MainWindow? Self { get; set; } = w;
|
||||
|
||||
[Obsolete("过时的")]
|
||||
public async Task<string?> ImportExcel()
|
||||
{
|
||||
var dialog = new OpenFileDialog
|
||||
{
|
||||
Title = "打开文件",
|
||||
AllowMultiple = false,
|
||||
Filters =
|
||||
[
|
||||
new FileDialogFilter { Name = "Excel Files", Extensions = { "*.xls; *.xlsx" } }
|
||||
]
|
||||
};
|
||||
var result = await dialog.ShowAsync(Self!);
|
||||
if (result is not { Length: 1 }) return null;
|
||||
try
|
||||
{
|
||||
return ConvertExcelToJson(result[0]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// [Obsolete("过时的")]
|
||||
// public async Task<string?> ImportExcel()
|
||||
// {
|
||||
// var dialog = new OpenFileDialog
|
||||
// {
|
||||
// Title = "打开文件",
|
||||
// AllowMultiple = false,
|
||||
// Filters =
|
||||
// [
|
||||
// new FileDialogFilter { Name = "Excel Files", Extensions = { "*.xls; *.xlsx" } }
|
||||
// ]
|
||||
// };
|
||||
// var result = await dialog.ShowAsync(Self!);
|
||||
// if (result is not { Length: 1 }) return null;
|
||||
// try
|
||||
// {
|
||||
// return ConvertExcelToJson(result[0]);
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
public static string ConvertExcelToJson(string excelFilePath)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
var fileInfo = new FileInfo(excelFilePath);
|
||||
using var package = new ExcelPackage(fileInfo);
|
||||
var worksheet = package.Workbook.Worksheets[0];
|
||||
var rowCount = worksheet.Dimension.Rows;
|
||||
var colCount = worksheet.Dimension.Columns;
|
||||
|
||||
var data = new List<Dictionary<string, object>>();
|
||||
var headers = Enumerable.Range(1, colCount)
|
||||
.Select(col => worksheet.Cells[1, col].Text)
|
||||
.ToList();
|
||||
for (var row = 2; row <= rowCount; row++)
|
||||
{
|
||||
var rowData = new Dictionary<string, object>();
|
||||
for (var col = 1; col <= colCount; col++)
|
||||
{
|
||||
rowData[headers[col - 1]] = worksheet.Cells[row, col].Text;
|
||||
}
|
||||
|
||||
data.Add(rowData);
|
||||
}
|
||||
return JsonSerializer.Serialize(data, new JsonSerializerOptions { WriteIndented = true, Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) });
|
||||
}
|
||||
// public static string ConvertExcelToJson(string excelFilePath)
|
||||
// {
|
||||
// ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
// var fileInfo = new FileInfo(excelFilePath);
|
||||
// using var package = new ExcelPackage(fileInfo);
|
||||
// var worksheet = package.Workbook.Worksheets[0];
|
||||
// var rowCount = worksheet.Dimension.Rows;
|
||||
// var colCount = worksheet.Dimension.Columns;
|
||||
//
|
||||
// var data = new List<Dictionary<string, object>>();
|
||||
// var headers = Enumerable.Range(1, colCount)
|
||||
// .Select(col => worksheet.Cells[1, col].Text)
|
||||
// .ToList();
|
||||
// for (var row = 2; row <= rowCount; row++)
|
||||
// {
|
||||
// var rowData = new Dictionary<string, object>();
|
||||
// for (var col = 1; col <= colCount; col++)
|
||||
// {
|
||||
// rowData[headers[col - 1]] = worksheet.Cells[row, col].Text;
|
||||
// }
|
||||
//
|
||||
// data.Add(rowData);
|
||||
// }
|
||||
// return JsonSerializer.Serialize(data, new JsonSerializerOptions { WriteIndented = true, Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) });
|
||||
// }
|
||||
|
||||
public Task SetIsLoading(bool isLoading)
|
||||
{
|
||||
|
@ -1,12 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -32,7 +33,6 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="OfficeOpenXml.Extension.AspNetCore" Version="1.0.0" />
|
||||
<PackageReference Include="PaddleOCRSharp" Version="4.4.0.2" />
|
||||
<PackageReference Include="RestSharp" Version="112.0.0" />
|
||||
<PackageReference Include="Serilog" Version="4.1.0" />
|
||||
@ -40,7 +40,6 @@
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
|
||||
<PackageReference Include="Tesseract" Version="5.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACommonBrowserAdapter_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Ff4f16e8c3bfe1b303dac9ad0491e3142f9d145ffbd9eaf32f291d9bb6cb31f_003FCommonBrowserAdapter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AControl_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Ff963a2a29ea2bb2d4ad8737293b45c4edbd94e55219dc42cf68343d6d91d9_003FControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AControl_002Ecs_002Fl_003AC_0021_003FUsers_003Fxiongwei_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Ff963a2a29ea2bb2d4ad8737293b45c4edbd94e55219dc42cf68343d6d91d9_003FControl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConvert_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2832e8c2b81f4641b3863f406ce3a519c90938_003Fa7_003Fbafa7f7b_003FConvert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConvert_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb2b917c507d64d0980727dbdd83b6585c8f8a0_003Fae_003F21158426_003FConvert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADbContext_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Faacc74311ca994f12b71cddb22241be9d6654c65e94f5985c5488dee396916f_003FDbContext_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADependencyResolverMixins_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fca0d4592dc494bbaa872fd9db942335922638_003Ff9_003Fb0105fc3_003FDependencyResolverMixins_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@ -29,6 +30,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonStringEnumConverter_002Ecs_002Fl_003AC_0021_003FUsers_003Fxiongwei_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fe8fd44bb4fe5af449849853612f32962e78c0e82a7b6a4307a7bcae61a547a_003FJsonStringEnumConverter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2832e8c2b81f4641b3863f406ce3a519c90938_003F91_003Ff40bad6e_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ALocator_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fcf54cc1573c8f4a376437dc7b76dc8161cde5af828e4b880c5826778c7de6ae5_003FLocator_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodBaseInvoker_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2832e8c2b81f4641b3863f406ce3a519c90938_003F8d_003Fd2910eb2_003FMethodBaseInvoker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodBaseInvoker_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fd882146b4f265f10bcbec2663fce248db9ffec5fa1aeaf76e32a11ba5eafcd6_003FMethodBaseInvoker_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANameScopeExtensions_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F262340175512b8eb1fbf3ba15178a24384aa0ef6c1e268ed6ca51d5c249e2_003FNameScopeExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AReactiveCommandBase_002Ecs_002Fl_003AC_0021_003FUsers_003FNick_0020Wang_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fd8c4af3416758fd750ab8cf4e2117d76fd3e73c9259c1517e228c75cd49fe_003FReactiveCommandBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
Loading…
Reference in New Issue
Block a user