Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
24d1285a
提交
24d1285a
编写于
12月 08, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
94628718
变更
30
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
447 行增加
和
982 行删除
+447
-982
copy.js
copy.js
+4
-3
avue.min.js
public/assets/js/avue.min.js
+0
-8
App.vue
src/App.vue
+0
-1
app-register.ts
src/app-register.ts
+0
-6
app-data-upload.less
src/components/app-data-upload/app-data-upload.less
+3
-1
app-data-upload.vue
src/components/app-data-upload/app-data-upload.vue
+96
-53
app-debug-actions.less
src/components/app-debug-actions/app-debug-actions.less
+0
-35
app-debug-actions.vue
src/components/app-debug-actions/app-debug-actions.vue
+0
-48
app-header-menus.less
src/components/app-header-menus/app-header-menus.less
+0
-73
app-header-menus.vue
src/components/app-header-menus/app-header-menus.vue
+0
-78
app-rawitem.vue
src/components/app-rawitem/app-rawitem.vue
+10
-1
app-studioaction.less
src/components/app-studioaction/app-studioaction.less
+0
-22
app-studioaction.vue
src/components/app-studioaction/app-studioaction.vue
+0
-84
app-field-image-dynamic.vue
...media/app-field-image-dynamic/app-field-image-dynamic.vue
+2
-8
ui-logic-active-ctrl-param.ts
src/logic/ui-logic/logic-param/ui-logic-active-ctrl-param.ts
+5
-3
ui-logic-entity-list-param.ts
src/logic/ui-logic/logic-param/ui-logic-entity-list-param.ts
+33
-0
panel-detail.ts
src/model/panel-detail/panel-detail.ts
+0
-1
entity-service.ts
src/service/entity-service.ts
+251
-226
default.less
src/styles/default.less
+18
-8
template.html
src/template.html
+0
-1
app-drawer.ts
src/utils/app-drawer/app-drawer.ts
+1
-0
app-modal.ts
src/utils/app-modal/app-modal.ts
+1
-1
app-popover.tsx
src/utils/app-popover/app-popover.tsx
+1
-0
index.ts
src/utils/index.ts
+1
-3
interceptor.ts
src/utils/interceptor/interceptor.ts
+0
-7
printarea.js
src/utils/print/packages/printarea.js
+1
-1
StudioActionUtil.ts
src/utils/studio-action/StudioActionUtil.ts
+0
-183
imgurl-base64.ts
src/utils/util/imgurl-base64.ts
+0
-126
util.ts
src/utils/util/util.ts
+18
-0
tsconfig.json
tsconfig.json
+2
-1
未找到文件。
copy.js
浏览文件 @
24d1285a
...
...
@@ -19,10 +19,11 @@ function copyFolder(copiedPath, resultPath, direct) {
console
.
log
(
`form
${
ccp
}
copy to
${
crp
}
`
);
}
else
{
try
{
fs
.
accessSync
(
path
.
join
(
crp
,
'..'
),
fs
.
constants
.
W_OK
);
copyFolder
(
ccp
,
crp
,
true
);
fs
.
accessSync
(
crp
,
fs
.
constants
.
F_OK
);
}
catch
(
error
)
{
console
.
log
(
'folder write error:'
,
error
);
fs
.
mkdirSync
(
crp
);
}
finally
{
copyFolder
(
ccp
,
crp
,
true
);
}
}
...
...
public/assets/js/avue.min.js
已删除
100644 → 0
浏览文件 @
94628718
因为 它太大了无法显示 源差异 。您可以改为
查看blob
。
src/App.vue
浏览文件 @
24d1285a
<
template
>
<div
id=
'app'
>
<app-debug-actions
/>
<router-view
v-if=
"isRouterAlive"
/>
</div>
</
template
>
...
...
src/app-register.ts
浏览文件 @
24d1285a
...
...
@@ -63,9 +63,6 @@ import AppRangeDate from './components/app-range-date/app-range-date.vue'
import
AppActionBar
from
'./components/app-actionbar/app-actionbar.vue'
import
AppOrgSector
from
'./components/app-orgsector/app-orgsector.vue'
import
AppBuild
from
'./components/app-build/app-build.vue'
import
AppStudioAction
from
'./components/app-studioaction/app-studioaction.vue'
import
AppDebugActions
from
'./components/app-debug-actions/app-debug-actions.vue'
import
AppHeaderMenus
from
'./components/app-header-menus/app-header-menus.vue'
import
AppColumnLink
from
'./components/app-column-link/app-column-link.vue'
import
DropDownListDynamic
from
'./components/dropdown-list-dynamic/dropdown-list-dynamic.vue'
import
AppImagePreview
from
'./components/app-image-preview/app-image-preview.vue'
...
...
@@ -222,9 +219,6 @@ export const AppComponents = {
v
.
component
(
'app-actionbar'
,
AppActionBar
);
v
.
component
(
'app-orgsector'
,
AppOrgSector
);
v
.
component
(
'app-build'
,
AppBuild
);
v
.
component
(
'app-studioaction'
,
AppStudioAction
);
v
.
component
(
'app-debug-actions'
,
AppDebugActions
);
v
.
component
(
'app-header-menus'
,
AppHeaderMenus
);
v
.
component
(
'app-column-link'
,
AppColumnLink
);
v
.
component
(
'app-data-upload'
,
()
=>
import
(
'./components/app-data-upload/app-data-upload.vue'
));
v
.
component
(
'dropdown-list-dynamic'
,
DropDownListDynamic
);
...
...
src/components/app-data-upload/app-data-upload.less
浏览文件 @
24d1285a
// 导入视图样式
.app-data-upload-view{
font-family: "Microsoft YaHei";
display: flex;
flex-direction: column;
.main-content{
height: calc(100% - 68px);
background: #FAFAFB;
...
...
@@ -41,7 +43,7 @@
}
}
.message-container{
height:
150px
;
height:
calc(100% - 26px)
;
display: flex;
justify-content: space-between;
ul li{
...
...
src/components/app-data-upload/app-data-upload.vue
浏览文件 @
24d1285a
此差异已折叠。
点击以展开。
src/components/app-debug-actions/app-debug-actions.less
已删除
100644 → 0
浏览文件 @
94628718
.app-debug-actions {
position: absolute;
top: 0px;
left: 50%;
z-index: 10000;
text-align: center;
transition: all 0.3s;
margin-top: -32px;
>.actions {
.ivu-btn {
width: 100%;
}
}
>.show-buttons {
width: 100%;
height: 18px;
border-width: 0px 1px 1px 1px;
border-style: solid;
border-color: #8893a7;
text-align: center;
color: #8893a7;
cursor: pointer;
>.button {
margin-top: -5px;
}
}
}
.app-debug-actions:hover {
margin-top: 0px;
}
\ No newline at end of file
src/components/app-debug-actions/app-debug-actions.vue
已删除
100644 → 0
浏览文件 @
94628718
<
template
>
<div
class=
"app-debug-actions"
v-if=
"isShow"
>
<div
class=
"actions"
>
<button-group
vertical
>
<i-button
:title=
"$t('components.appDebugActions.button')"
:type=
"sdc.isShowTool ? 'warning' : 'info'"
ghost
@
click=
"() => sdc.showToolChange()"
:icon=
"sdc.isShowTool ? 'ios-bug' : 'ios-bug-outline'"
></i-button>
</button-group>
</div>
<div
class=
"show-buttons"
>
<div
class=
"button"
><i
class=
"ivu-icon ivu-icon-ios-arrow-down"
/></div>
</div>
</div>
</
template
>
<
script
lang =
'ts'
>
import
{
Vue
,
Component
}
from
'vue-property-decorator'
;
import
{
StudioActionUtil
}
from
'@/utils'
;
import
{
Environment
}
from
'@/environments/environment'
;
/**
* 开发模式控制行为组
*
* @export
* @class AppDebugActions
* @extends {Vue}
*/
@
Component
({
})
export
default
class
AppDebugActions
extends
Vue
{
/**
* 是否显示
*
* @type {boolean}
* @memberof AppDebugActions
*/
public
isShow
:
boolean
=
Environment
.
devMode
;
/**
* 配置平台操作控制器
*
* @type {StudioActionController}
* @memberof AppDebugActions
*/
public
sdc
:
StudioActionUtil
=
StudioActionUtil
.
getInstance
();
}
</
script
>
<
style
lang =
"less"
>
@import "./app-debug-actions.less";
</
style
>
\ No newline at end of file
src/components/app-header-menus/app-header-menus.less
已删除
100644 → 0
浏览文件 @
94628718
.app-header-menus {
display: flex;
align-items: center;
height: 100%;
line-height: 20px;
>.app-header-menu-item{
height: 24px;
display: flex;
align-items: center;
margin-right: 16px;
color: #8893a7;
border: 1px solid rgba(0, 0, 0, 0);
cursor: pointer;
}
>.app-header-menu-item.icon {
>.app-header-menu-item-icon {
font-size: 20px;
}
>.app-header-menu-item-img {
height: 20px;
width: 20px;
>img {
height: 100%;
width: 100%;
}
}
}
>.app-header-menu-item.icon:hover{
color: #68758e;
text-decoration: none;
}
>.app-header-menu-item.text {
border-radius: 4px;
border: 1px solid #8893a7;
text-align: center;
font-size: 12px;
padding: 2px 4px;
>.app-header-menu-item-icon {
width: 20px;
height: 20px;
overflow: hidden;
font-size: 16px;
margin-right: 3px;
margin-top: -3px;
}
>.app-header-menu-item-img {
height: 16px;
width: 16px;
margin-right: 3px;
>img {
height: 100%;
width: 100%;
}
}
}
>.app-header-menu-item.text:hover {
color: #107fff;
border: 1px solid #107fff;
}
}
.app-header-menus:hover {
background: none !important;
}
\ No newline at end of file
src/components/app-header-menus/app-header-menus.vue
已删除
100644 → 0
浏览文件 @
94628718
<
template
>
<div
class=
"app-header-menus"
v-if=
"isShow"
>
<div
v-for=
"(menu,index) in menus"
:key=
"index"
class=
"app-header-menu-item text"
@
click=
"openWindow(menu)"
>
<div
class=
"app-header-menu-item-icon"
>
<i
:class=
"menu.iconcls"
:aria-hidden=
"true"
/>
</div>
<div
class=
"app-header-menu-item-text"
>
{{
$t
(
menu
.
title
)
}}
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Model
,
Emit
}
from
"vue-property-decorator"
;
import
{
Subject
}
from
"rxjs"
;
import
{
Environment
}
from
'@/environments/environment'
;
@
Component
({
})
export
default
class
AppHeaderMenus
extends
Vue
{
/**
* 是否显示
*
* @type {boolean}
* @memberof AppHeaderMenus
*/
public
isShow
:
boolean
=
Environment
.
devMode
;
/**
* 菜单数据
*
* @type {any}
* @memberof AppHeaderMenus
*/
public
menus
:
any
=
[
{
name
:
"ibizlab"
,
title
:
"components.appHeaderMenus.ibizlab.title"
,
url
:
Environment
.
ibizlabtUrl
,
iconcls
:
'fa fa-home'
,
},
{
name
:
"publishProject"
,
title
:
"components.appHeaderMenus.publishProject.title"
,
url
:
Environment
.
PublishProjectUrl
,
iconcls
:
'fa fa-folder-open-o'
,
},
{
name
:
"ibizstudio"
,
title
:
"components.appHeaderMenus.ibizstudio.title"
,
url
:
`
${
Environment
.
StudioUrl
}
?#/common_mosindex/srfkeys=
${
Environment
.
SysId
}
`
,
iconcls
:
'fa fa-wrench'
,
},
{
name
:
"ibizbbs"
,
title
:
"components.appHeaderMenus.ibizbbs.title"
,
url
:
Environment
.
ibizbbstUrl
,
iconcls
:
'fa fa-comments-o'
,
},
];
/**
* 触发界面行为
*
* @memberof AppHeaderMenus
*/
public
openWindow
(
menu
:
any
){
window
.
open
(
menu
.
url
,
'_blank'
);
}
}
</
script
>
<
style
lang=
'less'
>
@import "./app-header-menus.less";
</
style
>
\ No newline at end of file
src/components/app-rawitem/app-rawitem.vue
浏览文件 @
24d1285a
...
...
@@ -6,7 +6,8 @@
</div>
<div
v-else-if=
"Object.is(contentType,'HTML')"
:class=
"contentStyle"
v-html=
"htmlContent"
/>
<div
v-else-if=
"Object.is(contentType,'IMAGE')"
:class=
"contentStyle"
>
<i
:class=
"imageClass ? imageClass : ''"
></i>
<img
v-if=
"imageSrc && imageSrc !== ''"
:src=
"imageSrc"
/>
<i
v-if=
"imageClass"
:class=
"imageClass"
></i>
</div>
</div>
</
template
>
...
...
@@ -57,6 +58,14 @@ export default class AppRawItem extends Vue {
*/
@
Prop
()
public
imageClass
?:
string
;
/**
* 图片路径
*
* @type {strin}
* @memberof AppRawItem
*/
@
Prop
()
public
imageSrc
?:
string
;
/**
* 标题
*
...
...
src/components/app-studioaction/app-studioaction.less
已删除
100644 → 0
浏览文件 @
94628718
.app-studioaction {
.studio-config-container {
position: absolute;
top: 10px;
right: 30px;
z-index: 1;
background: rgba(22, 22, 22, 0.6);
border-radius: 5px;
display: flex;
>.title {
color: white;
border-right: 1px solid #333;
padding: 5px;
text-align: center;
}
>.actions {
display: flex;
}
}
}
\ No newline at end of file
src/components/app-studioaction/app-studioaction.vue
已删除
100644 → 0
浏览文件 @
94628718
<
template
>
<div
class=
"app-studioaction"
v-if=
"isDevMode"
>
<div
v-show=
"sdc.isShowTool"
class=
"studio-config-container"
>
<div
class=
"title"
>
{{
viewTitle
}}
</div>
<div
class=
"actions"
>
<div
class=
"action-item"
:title=
"$t('components.appStudioAction.configTitle')"
>
<i-button
type=
"text"
ghost
@
click=
"configView()"
>
{{
$t
(
'components.appStudioAction.configButton'
)
}}
</i-button>
</div>
<div
class=
"action-item"
:title=
"$t('components.appStudioAction.issueTitle')"
>
<i-button
type=
"text"
ghost
@
click=
"createIssues()"
>
{{
$t
(
'components.appStudioAction.issueButton'
)
}}
</i-button>
</div>
</div>
</div>
</div>
</
template
>
<
script
lang =
'ts'
>
import
{
Vue
,
Component
,
Inject
,
Prop
}
from
"vue-property-decorator"
;
import
{
Environment
}
from
'@/environments/environment'
;
import
{
StudioActionUtil
}
from
'@/utils'
;
@
Component
({
})
export
default
class
AppStudioAction
extends
Vue
{
/**
* 视图标题
*
* @type {string}
* @memberof AppStudioAction
*/
@
Prop
()
public
viewTitle
!
:
string
;
/**
* 视图名称
*
* @type {string}
* @memberof AppStudioAction
*/
@
Prop
()
public
viewName
!
:
string
;
/**
* 是否开发为环境
*
* @type {boolean}
* @memberof AppStudioAction
*/
public
isDevMode
:
boolean
=
Environment
.
devMode
;
/**
* 配置平台操作控制器
*
* @type {StudioActionController}
* @memberof AppStudioAction
*/
public
sdc
:
StudioActionUtil
=
StudioActionUtil
.
getInstance
();
/**
* 触发配置
*
* @protected
* @memberof AppStudioAction
*/
protected
configView
():
void
{
this
.
sdc
.
openStudioConfigView
(
this
.
viewName
);
}
/**
* 新建issues
*
* @protected
* @memberof AppStudioAction
*/
protected
createIssues
():
void
{
this
.
sdc
.
createdIssues
(
this
.
viewName
);
}
}
</
script
>
<
style
lang=
"less"
>
@import "./app-studioaction.less";
</
style
>
\ No newline at end of file
src/components/layout-element/media/app-field-image-dynamic/app-field-image-dynamic.vue
浏览文件 @
24d1285a
...
...
@@ -5,7 +5,6 @@
</
template
>
<
script
lang =
'ts'
>
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
'vue-property-decorator'
;
import
{
ImgurlBase64
}
from
'@/utils'
;
import
{
Environment
}
from
"@/environments/environment"
;
@
Component
({})
export
default
class
AppFieldImageDynamic
extends
Vue
{
...
...
@@ -119,13 +118,8 @@ export default class AppFieldImageDynamic extends Vue {
try
{
const
_files
=
JSON
.
parse
(
this
.
value
);
const
file
=
_files
instanceof
Array
?
_files
[
0
]
:
null
;
const
url
=
file
&&
file
.
id
?
`
${
this
.
downloadUrl
}
/
${
file
.
id
}
`
:
""
;
ImgurlBase64
.
getInstance
()
.
getImgURLOfBase64
(
url
)
.
then
((
res
:
any
)
=>
{
this
.
dynaImgUrl
=
res
;
});
const
url
=
file
&&
file
.
id
?
`
${
this
.
downloadUrl
}
/
${
file
.
id
}
`
:
""
;
this
.
dynaImgUrl
=
url
;
}
catch
(
error
)
{
this
.
dynaImgUrl
=
this
.
value
;
}
...
...
src/logic/ui-logic/logic-param/ui-logic-active-ctrl-param.ts
浏览文件 @
24d1285a
...
...
@@ -37,10 +37,12 @@ export class UILogicActiveCtrlParam extends UILogicParamBase {
* @memberof UILogicActiveCtrlParam
*/
private
getActiveCtrl
(
params
:
any
)
{
const
{
actioncontext
}
=
params
;
if
(
actioncontext
.
viewCtx
&&
actioncontext
.
viewCtx
.
ctrl
)
{
const
{
actioncontext
,
xData
}
=
params
;
if
(
xData
)
{
return
xData
;
}
else
if
(
actioncontext
.
viewCtx
&&
actioncontext
.
viewCtx
.
ctrl
)
{
return
actioncontext
.
viewCtx
.
ctrl
;
}
else
{
}
else
{
return
null
;
}
}
...
...
src/logic/ui-logic/logic-param/ui-logic-entity-list-param.ts
浏览文件 @
24d1285a
...
...
@@ -60,4 +60,37 @@ export class AppDeUILogicEntityListParam extends UILogicParamBase {
this
.
realValue
=
[];
}
/**
* 获取指定属性值
*
* @param {string} strName
* @memberof AppDeUILogicEntityListParam
*/
public
get
(
strName
:
string
)
{
if
(
Object
.
prototype
.
toString
.
call
(
this
.
realValue
)
!==
'[object Array]'
)
{
throw
new
Error
(
`逻辑参数
${
this
.
strCodeName
}
非对象类型参数无法执行获取指定属性值`
);
}
if
(
!
isNaN
(
Number
(
strName
)))
{
return
this
.
realValue
[
Number
(
strName
)];
}
throw
new
Error
(
`逻辑参数
${
this
.
strCodeName
}
对象列表类型参数无法获取非数值下标属性`
);
}
/**
* 设置指定属性值
*
* @param {string} strName
* @param {*} value
* @memberof AppDeUILogicEntityListParam
*/
public
set
(
strName
:
string
,
value
:
any
)
{
if
(
Object
.
prototype
.
toString
.
call
(
this
.
realValue
)
!==
'[object Array]'
)
{
throw
new
Error
(
`逻辑参数
${
this
.
strCodeName
}
无法执行绑定非对象列表类型参数`
);
}
if
(
isNaN
(
Number
(
strName
)))
{
throw
new
Error
(
`逻辑参数
${
this
.
strCodeName
}
对象列表类型参数无法执行绑定到非数值下标`
);
}
this
.
realValue
[
Number
(
strName
)]
=
value
;
}
}
\ No newline at end of file
src/model/panel-detail/panel-detail.ts
浏览文件 @
24d1285a
...
...
@@ -442,7 +442,6 @@ export class PanelDetailModel {
// 识别父FLEX
if
(
parentItem
)
{
if
(
parentItem
.
layout
==
'FLEX'
)
{
Object
.
assign
(
boxStyle
,
{
'display'
:
'contents'
});
Object
.
assign
(
boxStyle
,
{
'flex-grow'
:
this
.
flexGrow
?
this
.
flexGrow
:
0
});
}
// 识别SIMPLEFLEX
...
...
src/service/entity-service.ts
浏览文件 @
24d1285a
此差异已折叠。
点击以展开。
src/styles/default.less
浏览文件 @
24d1285a
...
...
@@ -45,18 +45,28 @@
.el-table th {
padding: 5px 0;
}
.el-table th.gutter:last-of-type {
display: block !important;
width: 10px !important;
}
.grid .el-table__body-wrapper .el-table__row td{
border-left: 1px solid rgb(245,245,245);
border-top: 1px solid rgb(245,245,245);
// 解决横向滚动条错位问题
.el-scrollbar__wrap {
// 滚动条样式
&::-webkit-scrollbar {
width: 10px;
height: 10px;
border: none;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
}
}
.el-table--enable-row-hover .el-table__body tr:hover>td {
background-color: #badfffba !important;
}
.grid .
el-table__body-wrapper .
grid-selected-row{
.grid .grid-selected-row{
background-color: #badfffba !important;
}
...
...
src/template.html
浏览文件 @
24d1285a
...
...
@@ -13,6 +13,5 @@
</noscript>
<div
id=
"app"
></div>
<script
src=
"./environments/environment.js"
></script>
<script
src=
"./assets/js/avue.min.js"
></script>
</body>
</html>
src/utils/app-drawer/app-drawer.ts
浏览文件 @
24d1285a
...
...
@@ -65,6 +65,7 @@ export class AppDrawer {
const
vm
=
new
Vue
({
store
:
store
,
i18n
:
i18n
,
router
:
(
window
as
any
).
appRouter
,
render
(
h
)
{
return
h
(
component
,
{
props
});
}
...
...
src/utils/app-modal/app-modal.ts
浏览文件 @
24d1285a
...
...
@@ -2,7 +2,6 @@ import Vue from 'vue';
import
{
Subject
}
from
'rxjs'
;
import
store
from
'../../store'
;
import
i18n
from
'@/locale'
;
import
{
ViewTool
}
from
'../view-tool/view-tool'
;
import
AppModalCompponent
from
"./app-modal.vue"
;
import
'./app-modal.less'
;
...
...
@@ -64,6 +63,7 @@ export class AppModal {
this
.
VueExample
=
new
Vue
({
store
:
store
,
i18n
:
i18n
,
router
:
(
window
as
any
).
appRouter
,
render
(
h
)
{
return
h
(
AppModalCompponent
,
{
props
});
}
...
...
src/utils/app-popover/app-popover.tsx
浏览文件 @
24d1285a
...
...
@@ -103,6 +103,7 @@ export class AppPopover {
this
.
vueExample
=
new
Vue
({
el
:
div
,
store
:
store
,
router
:
(
window
as
any
).
appRouter
,
i18n
:
i18n
,
data
:
{
content
:
null
,
width
:
300
,
height
:
300
},
methods
:
{
...
...
src/utils/index.ts
浏览文件 @
24d1285a
...
...
@@ -10,6 +10,4 @@ export { XMLWriter } from './xml-writer/xml-writer';
export
{
Errorlog
}
from
'./decorators/errorlog'
;
export
{
UIActionTool
}
from
'./uiaction-tool/uiaction-tool'
;
export
{
LoadAppData
}
from
'./load-app-data/load-app-data'
;
export
{
Interceptors
}
from
'./interceptor/interceptor'
;
export
{
StudioActionUtil
}
from
'./studio-action/StudioActionUtil'
;
export
{
ImgurlBase64
}
from
'./util/imgurl-base64'
;
\ No newline at end of file
export
{
Interceptors
}
from
'./interceptor/interceptor'
;
\ No newline at end of file
src/utils/interceptor/interceptor.ts
浏览文件 @
24d1285a
...
...
@@ -86,13 +86,6 @@ export class Interceptors {
if
(
appdata
&&
appdata
.
context
)
{
config
.
headers
[
'srforgsectorid'
]
=
appdata
.
context
.
srforgsectorid
;
}
if
(
!
window
.
localStorage
.
getItem
(
'token'
)){
let
arr
;
let
reg
=
new
RegExp
(
"(^| )ibzuaa-token=([^;]*)(;|$)"
);
if
(
arr
=
document
.
cookie
.
match
(
reg
)){
window
.
localStorage
.
setItem
(
'token'
,
unescape
(
arr
[
2
]));
}
}
if
(
window
.
localStorage
.
getItem
(
'token'
))
{
const
token
=
window
.
localStorage
.
getItem
(
'token'
);
config
.
headers
[
'Authorization'
]
=
`Bearer
${
token
}
`
;
...
...
src/utils/print/packages/printarea.js
浏览文件 @
24d1285a
...
...
@@ -198,7 +198,7 @@ export default class {
}
// 处理textarea
}
else
{
copiedInput
.
innerHTML
=
item
.
value
;
copiedInput
.
textContent
=
item
.
value
;
copiedInput
.
setAttribute
(
'html'
,
item
.
value
);
}
}
...
...
src/utils/studio-action/StudioActionUtil.ts
已删除
100644 → 0
浏览文件 @
94628718
import
Vue
from
'vue'
;
import
{
Http
}
from
'@/utils'
;
import
{
Environment
}
from
'@/environments/environment'
;
import
{
on
}
from
'@/utils/dom/dom'
;
/**
* Studio Debug工具类
*
* @export
* @class StudioActionUtil
*/
export
class
StudioActionUtil
{
/**
* 唯一实例
*
* @private
* @static
* @type {StudioActionUtil}
* @memberof StudioActionUtil
*/
private
static
readonly
instance
:
StudioActionUtil
=
new
StudioActionUtil
();
/**
* 是否启用
*
* @protected
* @type {boolean}
* @memberof StudioActionUtil
*/
protected
isEnable
:
boolean
=
Environment
.
devMode
;
/**
* 请求对象
*
* @protected
* @type {Http}
* @memberof StudioActionUtil
*/
protected
http
:
Http
=
Http
.
getInstance
();
/**
* 配置信息
*
* @protected
* @type {*}
* @memberof StudioActionUtil
*/
protected
config
:
any
=
null
;
/**
* 配置平台界面
*
* @protected
* @type {Window}
* @memberof StudioActionUtil
*/
protected
studioWin
:
Window
|
null
=
null
;
/**
* 是否显示开发配置工具栏
*
* @type {boolean}
* @memberof StudioActionUtil
*/
public
isShowTool
:
boolean
=
false
;
/**
* Creates an instance of StudioActionUtil.
* @memberof StudioActionUtil
*/
constructor
()
{
if
(
StudioActionUtil
.
instance
)
{
return
StudioActionUtil
.
instance
;
}
if
(
Environment
.
devMode
)
{
on
(
window
,
'keydown'
,
(
e
:
KeyboardEvent
)
=>
{
if
((
e
.
ctrlKey
||
e
.
metaKey
)
&&
e
.
keyCode
===
123
)
{
this
.
showToolChange
();
}
});
}
}
/**
* 为当前视图建立issues
*
* @param {string} viewName
* @returns {Promise<void>}
* @memberof StudioActionUtil
*/
public
async
createdIssues
(
viewName
:
string
):
Promise
<
void
>
{
const
config
:
any
=
await
this
.
getConfig
(
viewName
);
if
(
config
)
{
const
context
:
string
=
`视图模块:
${
config
.
viewmodule
}
\n视图标识:
${
config
.
viewname
}
\n视图类型:
${
config
.
viewtype
}
\n`
;
window
.
open
(
`
${
Environment
.
ProjectUrl
}
/issues/new?issue[title]=
${
encodeURIComponent
(
'问题'
)}
&issue[description]=
${
encodeURIComponent
(
context
)}
`
,
'_blank'
);
}
}
/**
* 打开Studio配置界面
*
* @param {string} viewName
* @returns {Promise<void>}
* @memberof StudioActionUtil
*/
public
async
openStudioConfigView
(
viewName
:
string
):
Promise
<
void
>
{
const
config
:
any
=
await
this
.
getConfig
(
viewName
);
if
(
config
)
{
const
params
:
any
=
{
"appType"
:
"APPSTUDIO"
,
"appKey"
:
Environment
.
AppId
,
"dataType"
:
"AppDesign_PSAppViewDesignRedirectView"
,
"srfkey"
:
config
.
viewtag
};
if
(
this
.
studioWin
&&
this
.
studioWin
.
closed
===
false
)
{
this
.
studioWin
.
postMessage
({
type
:
'OpenView'
,
params
},
'*'
);
Vue
.
prototype
.
$message
.
warning
(
'请在已打开的配置平台查看!'
);
}
else
{
if
(
Environment
.
debugOpenMode
===
'sln'
){
console
.
log
(
"打开sln未支持"
);
// this.studioWin = window.open(`${Environment.StudioUrl}?ov=${encodeURIComponent(JSON.stringify(params))}#/common_slnindex/srfkeys=${Environment.SlnId}/sysdesign_psdevslnsysmodeltreeexpview/srfkey=${Environment.SysId}`, '_blank');
}
else
{
this
.
studioWin
=
window
.
open
(
`
${
Environment
.
StudioUrl
}
?ov=
${
encodeURIComponent
(
JSON
.
stringify
(
params
))}
#/common_mosindex/srfkeys=
${
Environment
.
SysId
}
`
,
'_blank'
);
}
}
}
}
/**
* 获取视图配置参数
*
* @protected
* @param {string} viewName
* @returns {Promise<any>}
* @memberof StudioActionUtil
*/
protected
async
getConfig
(
viewName
:
string
):
Promise
<
any
>
{
if
(
!
this
.
config
)
{
await
this
.
loadConfig
();
}
return
this
.
config
[
viewName
];
}
/**
* 加载配置信息
*
* @protected
* @returns {Promise<void>}
* @memberof StudioActionUtil
*/
protected
async
loadConfig
():
Promise
<
void
>
{
const
response
:
any
=
await
this
.
http
.
get
(
'./assets/json/view-config.json'
);
if
(
response
&&
response
.
status
===
200
&&
response
.
data
)
{
this
.
config
=
response
.
data
}
else
{
console
.
warn
(
'Studio操作控制器,视图参数信息加载失败!'
);
}
}
/**
* 展示配置工具栏状态变更
*
* @memberof StudioActionController
*/
public
showToolChange
():
void
{
this
.
isShowTool
=
!
this
.
isShowTool
;
}
/**
* 获取实例
*
* @static
* @returns {StudioActionUtil}
* @memberof StudioActionUtil
*/
public
static
getInstance
():
StudioActionUtil
{
return
this
.
instance
;
}
}
\ No newline at end of file
src/utils/util/imgurl-base64.ts
已删除
100644 → 0
浏览文件 @
94628718
import
axios
from
'axios'
;
export
class
ImgurlBase64
{
/**
* 单例变量声明
*
* @memberof ImgurlBase64
*/
private
static
imgurlBase64
:
ImgurlBase64
;
/**
* 图片缓存(加载中)
*
* @type {Map<string,any>}
* @memberof ImgurlBase64
*/
public
static
imgCache
:
Map
<
string
,
any
>
=
new
Map
();
/**
* 图片缓存(已完成)
*
* @type {Map<string,any>}
* @memberof ImgurlBase64
*/
public
static
imgCached
:
Map
<
string
,
any
>
=
new
Map
();
/**
* 获取 ImgurlBase64 单例对象
*
* @memberof ImgurlBase64
*/
public
static
getInstance
()
{
if
(
!
this
.
imgurlBase64
)
{
this
.
imgurlBase64
=
new
ImgurlBase64
();
}
return
this
.
imgurlBase64
;
}
/**
* 手动获取图片
*
*
* @param url 图片url路径
* @returns
*/
public
async
getImgURLOfBase64
(
url
:
string
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
img
=
'/'
;
// 富文本CV上传图片与鼠标移出抛值冲突问题,上传成功回调还没执行时就抛值
var
reg
=
/^
\s
*data:
([
a-z
]
+
\/[
a-z0-9-+.
]
+
(
;
[
a-z-
]
+=
[
a-z0-9-
]
+
)?)?(
;base64
)?
,
([
a-z0-9!$&',()*+;=
\-
._~:@
\/
?%
\s]
*
?)\s
*$/i
;
if
(
reg
.
test
(
url
))
{
return
resolve
(
url
);
}
// 缓存中有从缓存中拿
if
(
ImgurlBase64
.
imgCached
.
get
(
url
))
{
let
img
=
ImgurlBase64
.
imgCached
.
get
(
url
);
resolve
(
img
);
}
const
callback
:
Function
=
(
url
:
string
,
promise
:
Promise
<
any
>
)
=>
{
promise
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
&&
response
.
data
)
{
// 获取文件名
const
disposition
=
response
.
headers
[
'content-disposition'
];
const
filename
=
disposition
.
split
(
'filename='
)[
1
];
let
type
=
'image/png'
;
if
(
filename
&&
filename
.
indexOf
(
'.'
)
>
0
)
{
const
start
=
filename
.
lastIndexOf
(
'.'
);
const
expandedName
=
filename
.
substring
(
start
+
1
);
if
(
expandedName
.
match
(
/
(
bmp|jpg|jpeg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp
)
/gi
)
!=
null
)
{
type
=
'image/'
+
expandedName
;
}
else
{
resolve
(
img
);
}
}
let
blob
=
new
Blob
([
response
.
data
],{
type
:
type
});
this
.
blobToBase64
(
blob
).
then
((
res
)
=>
{
// 转化后的base64
img
=
`
${
res
}
`
;
// 缓存图片
ImgurlBase64
.
imgCached
.
set
(
url
,
img
);
resolve
(
img
);
})
}
else
{
resolve
(
img
);
}
}).
catch
((
result
:
any
)
=>
{
return
resolve
(
img
);
})
}
// 加载中
if
(
ImgurlBase64
.
imgCache
.
get
(
url
))
{
callback
(
url
,
ImgurlBase64
.
imgCache
.
get
(
url
));
}
else
{
let
_url
=
url
;
if
(
!
Object
.
is
(
'/'
,
_url
.
substring
(
0
,
1
)))
{
_url
=
'/'
+
_url
;
}
let
result
:
Promise
<
any
>
=
axios
({
method
:
'get'
,
url
:
_url
,
responseType
:
'blob'
});
ImgurlBase64
.
imgCache
.
set
(
url
,
result
);
callback
(
url
,
result
);
}
});
}
/**
* 将blob转为base64
*
*
* @param blob blob对象
* @returns
*/
public
blobToBase64
(
blob
:
any
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
fileReader
=
new
FileReader
();
fileReader
.
onload
=
(
e
:
any
)
=>
{
resolve
(
e
.
target
.
result
);
};
// readAsDataURL
fileReader
.
readAsDataURL
(
blob
);
fileReader
.
onerror
=
()
=>
{
reject
(
new
Error
(
'blobToBase64 error'
));
};
});
}
}
\ No newline at end of file
src/utils/util/util.ts
浏览文件 @
24d1285a
...
...
@@ -589,4 +589,22 @@ export class Util {
throw
new
Error
(
`
${
layoutModelItem
.
itemType
}
暂不支持`
);
}
}
/**
* 清除附加数据(源数据里面有的数据在目标数据中都清除)
*
* @param source 源数据
* @param target 目标数据
*
* @memberof Util
*/
public
static
clearAdditionalData
(
source
:
any
,
target
:
any
)
{
if
(
target
&&
(
Object
.
keys
(
target
).
length
>
0
)
&&
source
&&
(
Object
.
keys
(
source
).
length
>
0
))
{
Object
.
keys
(
source
).
forEach
((
key
:
string
)
=>
{
if
(
target
.
hasOwnProperty
(
key
))
{
delete
target
[
key
];
}
})
}
}
}
\ No newline at end of file
tsconfig.json
浏览文件 @
24d1285a
...
...
@@ -56,6 +56,7 @@
"tests/**/*.tsx"
,
],
"exclude"
:
[
"node_modules"
"node_modules"
,
"user"
]
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录