Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdict
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdict
提交
a60d5573
提交
a60d5573
编写于
4月 16, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
35b39874
变更
17
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
262 行增加
和
577 行删除
+262
-577
package.json
app_web/package.json
+1
-0
app-register.ts
app_web/src/app-register.ts
+2
-0
app-format-data.less
app_web/src/components/app-format-data/app-format-data.less
+3
-0
app-format-data.vue
app_web/src/components/app-format-data/app-format-data.vue
+41
-0
app-radio-group.vue
app_web/src/components/app-radio-group/app-radio-group.vue
+16
-67
app-span.less
app_web/src/components/app-span/app-span.less
+6
-1
app-span.vue
app_web/src/components/app-span/app-span.vue
+4
-4
codelist.vue
app_web/src/components/codelist/codelist.vue
+7
-2
default-searchform-base.vue
...zdict-item/default-searchform/default-searchform-base.vue
+57
-225
main-grid-base.vue
...web/src/widgets/ibzdict-item/main-grid/main-grid-base.vue
+1
-1
default-searchform-base.vue
...ts/ibzdict/default-searchform/default-searchform-base.vue
+57
-225
main-grid-base.vue
app_web/src/widgets/ibzdict/main-grid/main-grid-base.vue
+1
-1
yarn.lock
app_web/yarn.lock
+1
-1
IIBZDictItemService.java
...ava/cn/ibizlab/core/dict/service/IIBZDictItemService.java
+11
-7
IIBZDictService.java
...in/java/cn/ibizlab/core/dict/service/IIBZDictService.java
+11
-7
IBZDictItemServiceImpl.java
...bizlab/core/dict/service/impl/IBZDictItemServiceImpl.java
+17
-18
IBZDictServiceImpl.java
...cn/ibizlab/core/dict/service/impl/IBZDictServiceImpl.java
+26
-18
未找到文件。
app_web/package.json
浏览文件 @
a60d5573
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
"file-saver"
:
"^2.0.2"
,
"file-saver"
:
"^2.0.2"
,
"font-awesome"
:
"^4.7.0"
,
"font-awesome"
:
"^4.7.0"
,
"interactjs"
:
"^1.9.4"
,
"interactjs"
:
"^1.9.4"
,
"moment"
:
"^2.24.0"
,
"path-to-regexp"
:
"^6.1.0"
,
"path-to-regexp"
:
"^6.1.0"
,
"qs"
:
"^6.9.1"
,
"qs"
:
"^6.9.1"
,
"rxjs"
:
"^6.5.4"
,
"rxjs"
:
"^6.5.4"
,
...
...
app_web/src/app-register.ts
浏览文件 @
a60d5573
...
@@ -66,6 +66,7 @@ import AppColumnLink from './components/app-column-link/app-column-link.vue'
...
@@ -66,6 +66,7 @@ import AppColumnLink from './components/app-column-link/app-column-link.vue'
import
AppDataUploadView
from
'./components/app-data-upload/app-data-upload.vue'
import
AppDataUploadView
from
'./components/app-data-upload/app-data-upload.vue'
import
DropDownListDynamic
from
'./components/dropdown-list-dynamic/dropdown-list-dynamic.vue'
import
DropDownListDynamic
from
'./components/dropdown-list-dynamic/dropdown-list-dynamic.vue'
import
AppImagePreview
from
'./components/app-image-preview/app-image-preview.vue'
import
AppImagePreview
from
'./components/app-image-preview/app-image-preview.vue'
import
AppFormatData
from
'./components/app-format-data/app-format-data.vue'
// 全局挂载UI实体服务注册中心
// 全局挂载UI实体服务注册中心
window
[
'uiServiceRegister'
]
=
uiServiceRegister
;
window
[
'uiServiceRegister'
]
=
uiServiceRegister
;
...
@@ -141,5 +142,6 @@ export const AppComponents = {
...
@@ -141,5 +142,6 @@ export const AppComponents = {
v
.
component
(
'app-data-upload'
,
AppDataUploadView
);
v
.
component
(
'app-data-upload'
,
AppDataUploadView
);
v
.
component
(
'dropdown-list-dynamic'
,
DropDownListDynamic
);
v
.
component
(
'dropdown-list-dynamic'
,
DropDownListDynamic
);
v
.
component
(
'app-image-preview'
,
AppImagePreview
);
v
.
component
(
'app-image-preview'
,
AppImagePreview
);
v
.
component
(
'app-format-data'
,
AppFormatData
);
},
},
};
};
\ No newline at end of file
app_web/src/components/app-format-data/app-format-data.less
0 → 100644
浏览文件 @
a60d5573
.app-format-data{
display: inline-block;
}
\ No newline at end of file
app_web/src/components/app-format-data/app-format-data.vue
0 → 100644
浏览文件 @
a60d5573
<
template
>
<span
class=
"app-format-data"
>
{{
getcurValue
()
}}
</span>
</
template
>
<
script
lang =
'ts'
>
import
{
Component
,
Vue
,
Prop
}
from
'vue-property-decorator'
;
import
moment
from
"moment"
;
@
Component
({})
export
default
class
AppFormatData
extends
Vue
{
/**
* 格式化正则
*
* @type {string}
* @memberof AppFormatData
*/
@
Prop
({
default
:
'YYYY-MM-DD HH:mm:ss'
})
public
format
?:
string
;
/**
* 传入数据
*
* @type {*}
* @memberof AppFormatData
*/
@
Prop
()
public
data
!
:
any
;
/**
* 显示值
*
* @memberof AppFormatData
*/
getcurValue
(){
return
moment
(
this
.
data
).
format
(
this
.
format
);
}
}
</
script
>
<
style
lang=
"less"
>
@import './app-format-data.less';
</
style
>
\ No newline at end of file
app_web/src/components/app-radio-group/app-radio-group.vue
浏览文件 @
a60d5573
<
template
>
<
template
>
<radio-group
class=
"app-radio-group"
v-model=
"
selectArray
"
>
<radio-group
class=
"app-radio-group"
v-model=
"
value
"
>
<radio
v-for=
"(_item,index) in items"
:key =
"index"
:label=
"_item.value"
:disabled=
"isDisabled || _item.disabled"
>
<radio
v-for=
"(_item,index) in items"
:key =
"index"
:label=
"_item.value"
:disabled=
"isDisabled || _item.disabled"
>
<span>
{{
Object
.
is
(
codelistType
,
'STATIC'
)
?
$t
(
'codelist.'
+
tag
+
'.'
+
_item
.
value
)
:
_item
.
text
}}
</span>
<span>
{{
Object
.
is
(
codelistType
,
'STATIC'
)
?
$t
(
'codelist.'
+
tag
+
'.'
+
_item
.
value
)
:
_item
.
text
}}
</span>
</radio>
</radio>
...
@@ -25,39 +25,41 @@ export default class AppRadioGroup extends Vue {
...
@@ -25,39 +25,41 @@ export default class AppRadioGroup extends Vue {
* @type {*}
* @type {*}
* @memberof AppRadioGroup
* @memberof AppRadioGroup
*/
*/
@
Model
(
'change'
)
value
?:
any
;
@
Model
(
'change'
)
item
?:
any
;
/**
/**
*
代码表标识
*
获取值
*
*
* @type {string}
* @memberof AppRadioGroup
* @memberof AppRadioGroup
*/
*/
@
Prop
()
public
tag
?:
string
;
get
value
()
{
return
this
.
item
;
}
/**
/**
*
代码表类型
*
设置值
*
*
* @type {string}
* @memberof AppRadioGroup
* @memberof AppRadioGroup
*/
*/
@
Prop
()
public
codelistType
?:
string
;
set
value
(
val
:
any
)
{
this
.
$emit
(
'change'
,
val
);
}
/**
/**
* 代码表
值分隔符
* 代码表
标识
*
*
* @type {string}
* @type {string}
* @memberof AppRadioGroup
* @memberof AppRadioGroup
*/
*/
@
Prop
(
{
default
:
';'
})
public
valueSeparator
?:
string
;
@
Prop
(
)
public
tag
?:
string
;
/**
/**
*
模式(数字或者字符串)
*
代码表类型
*
*
* @type {
*
}
* @type {
string
}
* @memberof App
CheckBox
* @memberof App
RadioGroup
*/
*/
@
Prop
(
{
default
:
'str'
})
mode
:
any
;
@
Prop
(
)
public
codelistType
?:
string
;
/**
/**
* 是否禁用
* 是否禁用
...
@@ -113,59 +115,6 @@ export default class AppRadioGroup extends Vue {
...
@@ -113,59 +115,6 @@ export default class AppRadioGroup extends Vue {
})
})
}
}
}
}
/**
* 选中数组
*
* @memberof AppRadioGroup
*/
get
selectArray
()
{
if
(
this
.
value
)
{
if
(
Object
.
is
(
this
.
mode
,
'num'
)
&&
this
.
items
)
{
let
selectsArray
:
Array
<
any
>
=
[];
let
num
:
number
=
parseInt
(
this
.
value
,
10
);
this
.
items
.
forEach
((
item
:
any
)
=>
{
if
((
num
&
item
.
value
)
==
item
.
value
)
{
selectsArray
.
push
(
item
.
value
);
}
});
return
selectsArray
;
}
else
if
(
Object
.
is
(
this
.
mode
,
'str'
))
{
if
(
this
.
value
!==
''
)
{
return
this
.
value
.
split
(
this
.
valueSeparator
);
}
}
}
else
{
return
[];
}
}
/**
* 设置选中
*
* @memberof AppRadioGroup
*/
set
selectArray
(
val
:
any
)
{
let
value
:
null
|
string
|
number
=
null
;
if
(
Object
.
is
(
this
.
mode
,
'num'
))
{
let
temp
:
number
=
0
;
val
.
forEach
((
item
:
any
)
=>
{
temp
=
temp
|
parseInt
(
item
,
10
);
});
value
=
temp
;
}
else
if
(
Object
.
is
(
this
.
mode
,
'str'
))
{
let
_datas
:
string
[]
=
[];
this
.
items
.
forEach
((
item
:
any
)
=>
{
const
index
=
val
.
findIndex
((
_key
:
any
)
=>
Object
.
is
(
item
.
value
,
_key
));
if
(
index
===
-
1
)
{
return
;
}
_datas
.
push
(
item
.
value
);
});
value
=
_datas
.
join
(
this
.
valueSeparator
);
}
this
.
$emit
(
'change'
,
value
);
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
app_web/src/components/app-span/app-span.less
浏览文件 @
a60d5573
.app-span{
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
overflow: hidden;
}
app_web/src/components/app-span/app-span.vue
浏览文件 @
a60d5573
<
template
>
<
template
>
<codelist
v-if=
"tag"
:tag=
"tag"
:value=
"value"
:codelistType=
"codelistType"
:renderMode=
"renderMode"
:valueSeparator=
"valueSeparator"
:textSeparator=
"textSeparator"
></codelist>
<codelist
v-if=
"tag"
:tag=
"tag"
:value=
"value"
:codelistType=
"codelistType"
:renderMode=
"renderMode"
:valueSeparator=
"valueSeparator"
:textSeparator=
"textSeparator"
></codelist>
<span
v-else
>
{{
text
}}
</span>
<span
class=
"app-span"
v-else
>
{{
text
}}
</span>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -39,7 +39,7 @@ export default class DropDownList extends Vue {
...
@@ -39,7 +39,7 @@ export default class DropDownList extends Vue {
* @type {boolean}
* @type {boolean}
* @memberof SelectPicker
* @memberof SelectPicker
*/
*/
@
Prop
()
public
renderMode
?:
string
;
@
Prop
(
{
default
:
"STR"
}
)
public
renderMode
?:
string
;
/**
/**
* 文本分隔符
* 文本分隔符
...
@@ -92,12 +92,12 @@ export default class DropDownList extends Vue {
...
@@ -92,12 +92,12 @@ export default class DropDownList extends Vue {
}
}
/**
/**
*
加载代码表
*
处理数据
*
*
* @memberof AppSpan
* @memberof AppSpan
*/
*/
public
load
(){
public
load
(){
if
(
this
.
tag
){
if
(
!
this
.
value
||
this
.
tag
){
return
;
//代码表走codelist组件
return
;
//代码表走codelist组件
}
else
if
(
Object
.
is
(
this
.
editorType
,
'PICTURE'
)
||
Object
.
is
(
this
.
editorType
,
'PICTURE_ONE'
)
||
Object
.
is
(
this
.
editorType
,
'FILEUPLOADER'
)){
}
else
if
(
Object
.
is
(
this
.
editorType
,
'PICTURE'
)
||
Object
.
is
(
this
.
editorType
,
'PICTURE_ONE'
)
||
Object
.
is
(
this
.
editorType
,
'FILEUPLOADER'
)){
let
files
:
any
[]
=
JSON
.
parse
(
this
.
value
);
let
files
:
any
[]
=
JSON
.
parse
(
this
.
value
);
...
...
app_web/src/components/codelist/codelist.vue
浏览文件 @
a60d5573
...
@@ -54,7 +54,7 @@ export default class CodeList extends Vue {
...
@@ -54,7 +54,7 @@ export default class CodeList extends Vue {
* @type {boolean}
* @type {boolean}
* @memberof SelectPicker
* @memberof SelectPicker
*/
*/
@
Prop
()
public
renderMode
?:
string
;
@
Prop
(
{
default
:
"STR"
}
)
public
renderMode
?:
string
;
/**
/**
* 文本分隔符
* 文本分隔符
...
@@ -213,5 +213,10 @@ export default class CodeList extends Vue {
...
@@ -213,5 +213,10 @@ export default class CodeList extends Vue {
</
script
>
</
script
>
<
style
lang=
'less'
>
<
style
lang=
'less'
>
.codelist {
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
overflow: hidden;
}
</
style
>
</
style
>
\ No newline at end of file
app_web/src/widgets/ibzdict-item/default-searchform/default-searchform-base.vue
浏览文件 @
a60d5573
...
@@ -156,7 +156,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -156,7 +156,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取多项数据
* 获取多项数据
*
*
* @returns {any[]}
* @returns {any[]}
* @memberof Default
* @memberof Default
Base
*/
*/
public
getDatas
():
any
[]
{
public
getDatas
():
any
[]
{
return
[
this
.
data
];
return
[
this
.
data
];
...
@@ -166,49 +166,25 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -166,49 +166,25 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取单项树
* 获取单项树
*
*
* @returns {*}
* @returns {*}
* @memberof Default
* @memberof Default
Base
*/
*/
public
getData
():
any
{
public
getData
():
any
{
return
this
.
data
;
return
this
.
data
;
}
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof Default
*/
@
Prop
({
default
:
false
})
protected
autosave
?:
boolean
;
/**
/**
* 显示处理提示
* 显示处理提示
*
*
* @type {boolean}
* @type {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
({
default
:
true
})
protected
showBusyIndicator
?:
boolean
;
@
Prop
({
default
:
true
})
protected
showBusyIndicator
?:
boolean
;
/**
* 部件行为--update
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
updateAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
removeAction
!
:
string
;
/**
/**
* 部件行为--loaddraft
* 部件行为--loaddraft
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
loaddraftAction
!
:
string
;
@
Prop
()
protected
loaddraftAction
!
:
string
;
...
@@ -216,31 +192,15 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -216,31 +192,15 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 部件行为--load
* 部件行为--load
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
loadAction
!
:
string
;
@
Prop
()
protected
loadAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
createAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
searchAction
!
:
string
;
/**
/**
* 视图标识
* 视图标识
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
viewtag
!
:
string
;
@
Prop
()
protected
viewtag
!
:
string
;
...
@@ -248,7 +208,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -248,7 +208,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单状态
* 表单状态
*
*
* @type {Subject<any>}
* @type {Subject<any>}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
formState
:
Subject
<
any
>
=
new
Subject
();
protected
formState
:
Subject
<
any
>
=
new
Subject
();
...
@@ -256,7 +216,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -256,7 +216,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 忽略表单项值变化
* 忽略表单项值变化
*
*
* @type {boolean}
* @type {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
ignorefieldvaluechange
:
boolean
=
false
;
protected
ignorefieldvaluechange
:
boolean
=
false
;
...
@@ -265,7 +225,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -265,7 +225,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {Subject<any>}
* @type {Subject<any>}
* @memberof Default
* @memberof Default
Base
*/
*/
private
dataChang
:
Subject
<
any
>
=
new
Subject
();
private
dataChang
:
Subject
<
any
>
=
new
Subject
();
...
@@ -274,7 +234,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -274,7 +234,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {(Subscription | undefined)}
* @type {(Subscription | undefined)}
* @memberof Default
* @memberof Default
Base
*/
*/
private
dataChangEvent
:
Subscription
|
undefined
;
private
dataChangEvent
:
Subscription
|
undefined
;
...
@@ -283,7 +243,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -283,7 +243,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
private
oldData
:
any
=
{};
private
oldData
:
any
=
{};
...
@@ -291,7 +251,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -291,7 +251,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单数据对象
* 表单数据对象
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
data
:
any
=
{
protected
data
:
any
=
{
n_ibzdictitemname_like
:
null
,
n_ibzdictitemname_like
:
null
,
...
@@ -302,7 +262,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -302,7 +262,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 属性值规则
* 属性值规则
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
rules
:
any
=
{
protected
rules
:
any
=
{
n_ibzdictitemname_like
:
[
n_ibzdictitemname_like
:
[
...
@@ -323,7 +283,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -323,7 +283,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 详情模型集合
* 详情模型集合
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
detailsModel
:
any
=
{
protected
detailsModel
:
any
=
{
formpage1
:
new
FormPageModel
({
caption
:
'常规条件'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
formpage1
:
new
FormPageModel
({
caption
:
'常规条件'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
...
@@ -339,7 +299,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -339,7 +299,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {*} newVal
* @param {*} newVal
* @param {*} oldVal
* @param {*} oldVal
* @memberof Default
* @memberof Default
Base
*/
*/
@
Watch
(
'data.n_ibzdictitemname_like'
)
@
Watch
(
'data.n_ibzdictitemname_like'
)
onN_ibzdictitemname_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
onN_ibzdictitemname_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
...
@@ -351,7 +311,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -351,7 +311,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {*} newVal
* @param {*} newVal
* @param {*} oldVal
* @param {*} oldVal
* @memberof Default
* @memberof Default
Base
*/
*/
@
Watch
(
'data.n_dictitemval_like'
)
@
Watch
(
'data.n_dictitemval_like'
)
onN_dictitemval_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
onN_dictitemval_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
...
@@ -364,7 +324,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -364,7 +324,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Default
* @memberof Default
Base
*/
*/
private
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
}
...
@@ -374,7 +334,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -374,7 +334,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Default
* @memberof Default
Base
*/
*/
private
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
...
@@ -389,7 +349,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -389,7 +349,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
private
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
if
(
this
.
ignorefieldvaluechange
)
{
if
(
this
.
ignorefieldvaluechange
)
{
...
@@ -405,7 +365,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -405,7 +365,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {*} [data={}]
* @param {*} [data={}]
* @memberof Default
* @memberof Default
Base
*/
*/
private
onFormLoad
(
data
:
any
=
{}):
void
{
private
onFormLoad
(
data
:
any
=
{}):
void
{
this
.
setFormEnableCond
(
data
);
this
.
setFormEnableCond
(
data
);
...
@@ -417,7 +377,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -417,7 +377,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充
* 值填充
*
*
* @param {*} [_datas={}]
* @param {*} [_datas={}]
* @memberof Default
* @memberof Default
Base
*/
*/
protected
fillForm
(
_datas
:
any
=
{}):
void
{
protected
fillForm
(
_datas
:
any
=
{}):
void
{
this
.
ignorefieldvaluechange
=
true
;
this
.
ignorefieldvaluechange
=
true
;
...
@@ -436,7 +396,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -436,7 +396,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @protected
* @protected
* @param {*} data
* @param {*} data
* @memberof Default
* @memberof Default
Base
*/
*/
protected
setFormEnableCond
(
data
:
any
):
void
{
protected
setFormEnableCond
(
data
:
any
):
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
...
@@ -452,7 +412,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -452,7 +412,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 重置草稿表单状态
* 重置草稿表单状态
*
*
* @private
* @private
* @memberof Default
* @memberof Default
Base
*/
*/
private
resetDraftFormStates
():
void
{
private
resetDraftFormStates
():
void
{
const
form
:
any
=
this
.
$refs
.
form
;
const
form
:
any
=
this
.
$refs
.
form
;
...
@@ -464,7 +424,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -464,7 +424,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 重置校验结果
* 重置校验结果
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
resetValidates
():
void
{
protected
resetValidates
():
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
...
@@ -480,7 +440,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -480,7 +440,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 填充校验结果 (后台)
* 填充校验结果 (后台)
*
*
* @param {any[]} fieldErrors
* @param {any[]} fieldErrors
* @memberof Default
* @memberof Default
Base
*/
*/
protected
fillValidates
(
fieldErrors
:
any
[]):
void
{
protected
fillValidates
(
fieldErrors
:
any
[]):
void
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
...
@@ -498,7 +458,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -498,7 +458,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单校验状态
* 表单校验状态
*
*
* @returns {boolean}
* @returns {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
formValidateStatus
():
boolean
{
protected
formValidateStatus
():
boolean
{
const
form
:
any
=
this
.
$refs
.
searchform
;
const
form
:
any
=
this
.
$refs
.
searchform
;
...
@@ -513,7 +473,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -513,7 +473,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取全部值
* 获取全部值
*
*
* @returns {*}
* @returns {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
getValues
():
any
{
protected
getValues
():
any
{
return
this
.
data
;
return
this
.
data
;
...
@@ -524,7 +484,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -524,7 +484,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {{ name: string, value: any }} $event
* @param {{ name: string, value: any }} $event
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
protected
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
if
(
!
$event
)
{
if
(
!
$event
)
{
...
@@ -542,7 +502,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -542,7 +502,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {string} name
* @param {string} name
* @param {*} value
* @param {*} value
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
protected
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
...
@@ -560,7 +520,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -560,7 +520,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 分组界面行为事件
* 分组界面行为事件
*
*
* @param {*} $event
* @param {*} $event
* @memberof Default
* @memberof Default
Base
*/
*/
protected
groupUIActionClick
(
$event
:
any
):
void
{
protected
groupUIActionClick
(
$event
:
any
):
void
{
if
(
!
$event
)
{
if
(
!
$event
)
{
...
@@ -572,7 +532,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -572,7 +532,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* Vue声明周期(处理组件的输入属性)
* Vue声明周期(处理组件的输入属性)
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
created
():
void
{
protected
created
():
void
{
this
.
afterCreated
();
this
.
afterCreated
();
...
@@ -581,7 +541,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -581,7 +541,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 执行created后的逻辑
* 执行created后的逻辑
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
afterCreated
(){
protected
afterCreated
(){
if
(
this
.
viewState
)
{
if
(
this
.
viewState
)
{
...
@@ -598,26 +558,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -598,26 +558,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
this
.
loadDraft
(
data
);
this
.
loadDraft
(
data
);
}
}
if
(
Object
.
is
(
'save'
,
action
))
{
this
.
save
(
data
);
}
});
});
}
}
this
.
dataChang
.
pipe
(
debounceTime
(
300
),
distinctUntilChanged
()
).
subscribe
((
data
:
any
)
=>
{
if
(
this
.
autosave
)
{
this
.
autoSave
();
}
});
}
}
/**
/**
* vue 生命周期
* vue 生命周期
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
destroyed
()
{
protected
destroyed
()
{
this
.
afterDestroy
();
this
.
afterDestroy
();
...
@@ -626,7 +574,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -626,7 +574,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 执行destroyed后的逻辑
* 执行destroyed后的逻辑
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
afterDestroy
()
{
protected
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
if
(
this
.
viewStateEvent
)
{
...
@@ -637,42 +585,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -637,42 +585,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
}
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof Default
*/
protected
copy
(
arg
:
any
=
{}):
void
{
this
.
loadDraft
(
arg
);
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Default
*/
protected
refresh
(
args
:
any
[]):
void
{
let
arg
:
any
=
{};
if
(
this
.
data
.
srfkey
&&
!
Object
.
is
(
this
.
data
.
srfkey
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkey
});
this
.
load
(
arg
);
return
;
}
if
(
this
.
data
.
srfkeys
&&
!
Object
.
is
(
this
.
data
.
srfkeys
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkeys
});
this
.
load
(
arg
);
return
;
}
}
/**
/**
* 自动加载
* 自动加载
*
*
* @param {*} [arg={}]
* @param {*} [arg={}]
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
autoLoad
(
arg
:
any
=
{}):
void
{
protected
autoLoad
(
arg
:
any
=
{}):
void
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
...
@@ -693,7 +611,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -693,7 +611,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {*} [opt={}]
* @param {*} [opt={}]
* @memberof Default
* @memberof Default
Base
*/
*/
private
load
(
opt
:
any
=
{}):
void
{
private
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
if
(
!
this
.
loadAction
){
...
@@ -730,9 +648,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -730,9 +648,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 加载草稿
* 加载草稿
*
*
* @param {*} [opt={}]
* @param {*} [opt={}]
* @memberof Default
* @memberof Default
Base
*/
*/
protected
loadDraft
(
opt
:
any
=
{}):
void
{
protected
loadDraft
(
opt
:
any
=
{}
,
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'IBZDictItemGridView视图搜索表单loaddraftAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'IBZDictItemGridView视图搜索表单loaddraftAction参数未配置'
});
return
;
return
;
...
@@ -751,10 +669,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -751,10 +669,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
const
data
=
response
.
data
;
const
data
=
response
.
data
;
this
.
resetDraftFormStates
();
this
.
resetDraftFormStates
();
this
.
onFormLoad
(
data
);
this
.
onFormLoad
(
data
);
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
form
:
any
=
this
.
$refs
.
form
;
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
if
(
form
)
{
...
@@ -765,50 +679,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -765,50 +679,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
});
});
}
}
});
});
}).
catch
((
response
:
any
)
=>
{
if
(
Object
.
is
(
mode
,
'RESET'
)){
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
const
{
data
:
_data
}
=
response
;
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof Default
*/
protected
autoSave
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
formValidateStatus
())
{
if
(
!
this
.
formValidateStatus
())
{
return
;
return
;
}
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
}
this
.
$emit
(
'load'
,
data
);
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
);
this
.
$emit
(
'save'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'
save
'
,
data
:
data
});
this
.
formState
.
next
({
type
:
'
load
'
,
data
:
data
});
});
});
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
if
(
response
&&
response
.
status
===
401
)
{
...
@@ -818,62 +696,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -818,62 +696,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
return
;
}
}
});
}
/**
const
{
data
:
_data
}
=
response
;
* 保存
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @returns {Promise<any>}
* @memberof Default
*/
protected
async
save
(
opt
:
any
=
{},
showResultInfo
?:
boolean
):
Promise
<
any
>
{
showResultInfo
=
showResultInfo
===
undefined
?
true
:
false
;
if
(
!
this
.
formValidateStatus
())
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'值规则校验异常'
});
return
;
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
);
this
.
$emit
(
'save'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'save'
,
data
:
data
});
});
if
(
showResultInfo
)
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
data
.
srfmajortext
?
data
.
srfmajortext
:
''
)
+
' 保存成功!'
});
}
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
})
}
}
/**
/**
...
@@ -884,7 +710,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -884,7 +710,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {string[]} updateDetails 更新项
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
protected
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
...
@@ -894,28 +720,34 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -894,28 +720,34 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 回车事件
* 回车事件
*
*
* @param {*} $event
* @param {*} $event
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onEnter
(
$event
:
any
):
void
{
protected
onEnter
(
$event
:
any
):
void
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'load'
,
this
.
data
);
this
.
$emit
(
'load'
,
this
.
data
);
}
}
/**
/**
* 搜索
* 搜索
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onSearch
()
{
protected
onSearch
()
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'load'
,
this
.
data
);
this
.
$emit
(
'load'
,
this
.
data
);
}
}
/**
/**
* 重置
* 重置
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onReset
()
{
protected
onReset
()
{
this
.
loadDraft
();
this
.
loadDraft
(
{},
'RESET'
);
}
}
}
}
</
script
>
</
script
>
...
...
app_web/src/widgets/ibzdict-item/main-grid/main-grid-base.vue
浏览文件 @
a60d5573
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<
template
v-if=
"getColumnState('updatedate')"
>
<
template
v-if=
"getColumnState('updatedate')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'updatedate'"
:label=
"$t('ibzdictitem.main_grid.columns.updatedate')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<el-table-column
show-overflow-tooltip
:prop=
"'updatedate'"
:label=
"$t('ibzdictitem.main_grid.columns.updatedate')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot=
"
{row,column}">
<template
v-slot=
"
{row,column}">
<
span>
{{
row
.
updatedate
}}
</span
>
<
app-format-data
format=
"%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS"
:data=
"row.updatedate"
></app-format-data
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</template>
</template>
...
...
app_web/src/widgets/ibzdict/default-searchform/default-searchform-base.vue
浏览文件 @
a60d5573
...
@@ -156,7 +156,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -156,7 +156,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取多项数据
* 获取多项数据
*
*
* @returns {any[]}
* @returns {any[]}
* @memberof Default
* @memberof Default
Base
*/
*/
public
getDatas
():
any
[]
{
public
getDatas
():
any
[]
{
return
[
this
.
data
];
return
[
this
.
data
];
...
@@ -166,49 +166,25 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -166,49 +166,25 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取单项树
* 获取单项树
*
*
* @returns {*}
* @returns {*}
* @memberof Default
* @memberof Default
Base
*/
*/
public
getData
():
any
{
public
getData
():
any
{
return
this
.
data
;
return
this
.
data
;
}
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof Default
*/
@
Prop
({
default
:
false
})
protected
autosave
?:
boolean
;
/**
/**
* 显示处理提示
* 显示处理提示
*
*
* @type {boolean}
* @type {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
({
default
:
true
})
protected
showBusyIndicator
?:
boolean
;
@
Prop
({
default
:
true
})
protected
showBusyIndicator
?:
boolean
;
/**
* 部件行为--update
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
updateAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
removeAction
!
:
string
;
/**
/**
* 部件行为--loaddraft
* 部件行为--loaddraft
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
loaddraftAction
!
:
string
;
@
Prop
()
protected
loaddraftAction
!
:
string
;
...
@@ -216,31 +192,15 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -216,31 +192,15 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 部件行为--load
* 部件行为--load
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
loadAction
!
:
string
;
@
Prop
()
protected
loadAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
createAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Default
*/
@
Prop
()
protected
searchAction
!
:
string
;
/**
/**
* 视图标识
* 视图标识
*
*
* @type {string}
* @type {string}
* @memberof Default
* @memberof Default
Base
*/
*/
@
Prop
()
protected
viewtag
!
:
string
;
@
Prop
()
protected
viewtag
!
:
string
;
...
@@ -248,7 +208,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -248,7 +208,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单状态
* 表单状态
*
*
* @type {Subject<any>}
* @type {Subject<any>}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
formState
:
Subject
<
any
>
=
new
Subject
();
protected
formState
:
Subject
<
any
>
=
new
Subject
();
...
@@ -256,7 +216,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -256,7 +216,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 忽略表单项值变化
* 忽略表单项值变化
*
*
* @type {boolean}
* @type {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
ignorefieldvaluechange
:
boolean
=
false
;
protected
ignorefieldvaluechange
:
boolean
=
false
;
...
@@ -265,7 +225,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -265,7 +225,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {Subject<any>}
* @type {Subject<any>}
* @memberof Default
* @memberof Default
Base
*/
*/
private
dataChang
:
Subject
<
any
>
=
new
Subject
();
private
dataChang
:
Subject
<
any
>
=
new
Subject
();
...
@@ -274,7 +234,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -274,7 +234,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {(Subscription | undefined)}
* @type {(Subscription | undefined)}
* @memberof Default
* @memberof Default
Base
*/
*/
private
dataChangEvent
:
Subscription
|
undefined
;
private
dataChangEvent
:
Subscription
|
undefined
;
...
@@ -283,7 +243,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -283,7 +243,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
private
oldData
:
any
=
{};
private
oldData
:
any
=
{};
...
@@ -291,7 +251,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -291,7 +251,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单数据对象
* 表单数据对象
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
data
:
any
=
{
protected
data
:
any
=
{
n_ibzdictid_like
:
null
,
n_ibzdictid_like
:
null
,
...
@@ -302,7 +262,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -302,7 +262,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 属性值规则
* 属性值规则
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
rules
:
any
=
{
protected
rules
:
any
=
{
n_ibzdictid_like
:
[
n_ibzdictid_like
:
[
...
@@ -323,7 +283,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -323,7 +283,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 详情模型集合
* 详情模型集合
*
*
* @type {*}
* @type {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
detailsModel
:
any
=
{
protected
detailsModel
:
any
=
{
formpage1
:
new
FormPageModel
({
caption
:
'常规条件'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
formpage1
:
new
FormPageModel
({
caption
:
'常规条件'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
...
@@ -339,7 +299,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -339,7 +299,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {*} newVal
* @param {*} newVal
* @param {*} oldVal
* @param {*} oldVal
* @memberof Default
* @memberof Default
Base
*/
*/
@
Watch
(
'data.n_ibzdictid_like'
)
@
Watch
(
'data.n_ibzdictid_like'
)
onN_ibzdictid_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
onN_ibzdictid_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
...
@@ -351,7 +311,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -351,7 +311,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {*} newVal
* @param {*} newVal
* @param {*} oldVal
* @param {*} oldVal
* @memberof Default
* @memberof Default
Base
*/
*/
@
Watch
(
'data.n_ibzdictname_like'
)
@
Watch
(
'data.n_ibzdictname_like'
)
onN_ibzdictname_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
onN_ibzdictname_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
...
@@ -364,7 +324,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -364,7 +324,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Default
* @memberof Default
Base
*/
*/
private
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
}
...
@@ -374,7 +334,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -374,7 +334,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Default
* @memberof Default
Base
*/
*/
private
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
...
@@ -389,7 +349,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -389,7 +349,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @private
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
private
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
private
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
if
(
this
.
ignorefieldvaluechange
)
{
if
(
this
.
ignorefieldvaluechange
)
{
...
@@ -405,7 +365,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -405,7 +365,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {*} [data={}]
* @param {*} [data={}]
* @memberof Default
* @memberof Default
Base
*/
*/
private
onFormLoad
(
data
:
any
=
{}):
void
{
private
onFormLoad
(
data
:
any
=
{}):
void
{
this
.
setFormEnableCond
(
data
);
this
.
setFormEnableCond
(
data
);
...
@@ -417,7 +377,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -417,7 +377,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充
* 值填充
*
*
* @param {*} [_datas={}]
* @param {*} [_datas={}]
* @memberof Default
* @memberof Default
Base
*/
*/
protected
fillForm
(
_datas
:
any
=
{}):
void
{
protected
fillForm
(
_datas
:
any
=
{}):
void
{
this
.
ignorefieldvaluechange
=
true
;
this
.
ignorefieldvaluechange
=
true
;
...
@@ -436,7 +396,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -436,7 +396,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @protected
* @protected
* @param {*} data
* @param {*} data
* @memberof Default
* @memberof Default
Base
*/
*/
protected
setFormEnableCond
(
data
:
any
):
void
{
protected
setFormEnableCond
(
data
:
any
):
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
...
@@ -452,7 +412,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -452,7 +412,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 重置草稿表单状态
* 重置草稿表单状态
*
*
* @private
* @private
* @memberof Default
* @memberof Default
Base
*/
*/
private
resetDraftFormStates
():
void
{
private
resetDraftFormStates
():
void
{
const
form
:
any
=
this
.
$refs
.
form
;
const
form
:
any
=
this
.
$refs
.
form
;
...
@@ -464,7 +424,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -464,7 +424,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 重置校验结果
* 重置校验结果
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
resetValidates
():
void
{
protected
resetValidates
():
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
...
@@ -480,7 +440,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -480,7 +440,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 填充校验结果 (后台)
* 填充校验结果 (后台)
*
*
* @param {any[]} fieldErrors
* @param {any[]} fieldErrors
* @memberof Default
* @memberof Default
Base
*/
*/
protected
fillValidates
(
fieldErrors
:
any
[]):
void
{
protected
fillValidates
(
fieldErrors
:
any
[]):
void
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
...
@@ -498,7 +458,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -498,7 +458,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 表单校验状态
* 表单校验状态
*
*
* @returns {boolean}
* @returns {boolean}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
formValidateStatus
():
boolean
{
protected
formValidateStatus
():
boolean
{
const
form
:
any
=
this
.
$refs
.
searchform
;
const
form
:
any
=
this
.
$refs
.
searchform
;
...
@@ -513,7 +473,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -513,7 +473,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取全部值
* 获取全部值
*
*
* @returns {*}
* @returns {*}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
getValues
():
any
{
protected
getValues
():
any
{
return
this
.
data
;
return
this
.
data
;
...
@@ -524,7 +484,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -524,7 +484,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @param {{ name: string, value: any }} $event
* @param {{ name: string, value: any }} $event
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
protected
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
if
(
!
$event
)
{
if
(
!
$event
)
{
...
@@ -542,7 +502,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -542,7 +502,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {string} name
* @param {string} name
* @param {*} value
* @param {*} value
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
protected
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
...
@@ -560,7 +520,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -560,7 +520,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 分组界面行为事件
* 分组界面行为事件
*
*
* @param {*} $event
* @param {*} $event
* @memberof Default
* @memberof Default
Base
*/
*/
protected
groupUIActionClick
(
$event
:
any
):
void
{
protected
groupUIActionClick
(
$event
:
any
):
void
{
if
(
!
$event
)
{
if
(
!
$event
)
{
...
@@ -572,7 +532,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -572,7 +532,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* Vue声明周期(处理组件的输入属性)
* Vue声明周期(处理组件的输入属性)
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
created
():
void
{
protected
created
():
void
{
this
.
afterCreated
();
this
.
afterCreated
();
...
@@ -581,7 +541,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -581,7 +541,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 执行created后的逻辑
* 执行created后的逻辑
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
afterCreated
(){
protected
afterCreated
(){
if
(
this
.
viewState
)
{
if
(
this
.
viewState
)
{
...
@@ -598,26 +558,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -598,26 +558,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
this
.
loadDraft
(
data
);
this
.
loadDraft
(
data
);
}
}
if
(
Object
.
is
(
'save'
,
action
))
{
this
.
save
(
data
);
}
});
});
}
}
this
.
dataChang
.
pipe
(
debounceTime
(
300
),
distinctUntilChanged
()
).
subscribe
((
data
:
any
)
=>
{
if
(
this
.
autosave
)
{
this
.
autoSave
();
}
});
}
}
/**
/**
* vue 生命周期
* vue 生命周期
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
destroyed
()
{
protected
destroyed
()
{
this
.
afterDestroy
();
this
.
afterDestroy
();
...
@@ -626,7 +574,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -626,7 +574,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
/**
* 执行destroyed后的逻辑
* 执行destroyed后的逻辑
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
afterDestroy
()
{
protected
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
if
(
this
.
viewStateEvent
)
{
...
@@ -637,42 +585,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -637,42 +585,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
}
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof Default
*/
protected
copy
(
arg
:
any
=
{}):
void
{
this
.
loadDraft
(
arg
);
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Default
*/
protected
refresh
(
args
:
any
[]):
void
{
let
arg
:
any
=
{};
if
(
this
.
data
.
srfkey
&&
!
Object
.
is
(
this
.
data
.
srfkey
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkey
});
this
.
load
(
arg
);
return
;
}
if
(
this
.
data
.
srfkeys
&&
!
Object
.
is
(
this
.
data
.
srfkeys
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkeys
});
this
.
load
(
arg
);
return
;
}
}
/**
/**
* 自动加载
* 自动加载
*
*
* @param {*} [arg={}]
* @param {*} [arg={}]
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
autoLoad
(
arg
:
any
=
{}):
void
{
protected
autoLoad
(
arg
:
any
=
{}):
void
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
...
@@ -693,7 +611,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -693,7 +611,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
*
* @private
* @private
* @param {*} [opt={}]
* @param {*} [opt={}]
* @memberof Default
* @memberof Default
Base
*/
*/
private
load
(
opt
:
any
=
{}):
void
{
private
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
if
(
!
this
.
loadAction
){
...
@@ -730,9 +648,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -730,9 +648,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 加载草稿
* 加载草稿
*
*
* @param {*} [opt={}]
* @param {*} [opt={}]
* @memberof Default
* @memberof Default
Base
*/
*/
protected
loadDraft
(
opt
:
any
=
{}):
void
{
protected
loadDraft
(
opt
:
any
=
{}
,
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'IBZDictGridView视图搜索表单loaddraftAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'IBZDictGridView视图搜索表单loaddraftAction参数未配置'
});
return
;
return
;
...
@@ -751,10 +669,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -751,10 +669,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
const
data
=
response
.
data
;
const
data
=
response
.
data
;
this
.
resetDraftFormStates
();
this
.
resetDraftFormStates
();
this
.
onFormLoad
(
data
);
this
.
onFormLoad
(
data
);
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
form
:
any
=
this
.
$refs
.
form
;
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
if
(
form
)
{
...
@@ -765,50 +679,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -765,50 +679,14 @@ export default class DefaultBase extends Vue implements ControlInterface {
});
});
}
}
});
});
}).
catch
((
response
:
any
)
=>
{
if
(
Object
.
is
(
mode
,
'RESET'
)){
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
const
{
data
:
_data
}
=
response
;
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof Default
*/
protected
autoSave
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
formValidateStatus
())
{
if
(
!
this
.
formValidateStatus
())
{
return
;
return
;
}
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
}
this
.
$emit
(
'load'
,
data
);
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
);
this
.
$emit
(
'save'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'
save
'
,
data
:
data
});
this
.
formState
.
next
({
type
:
'
load
'
,
data
:
data
});
});
});
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
if
(
response
&&
response
.
status
===
401
)
{
...
@@ -818,62 +696,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -818,62 +696,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
return
;
}
}
});
}
/**
const
{
data
:
_data
}
=
response
;
* 保存
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @returns {Promise<any>}
* @memberof Default
*/
protected
async
save
(
opt
:
any
=
{},
showResultInfo
?:
boolean
):
Promise
<
any
>
{
showResultInfo
=
showResultInfo
===
undefined
?
true
:
false
;
if
(
!
this
.
formValidateStatus
())
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'值规则校验异常'
});
return
;
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
);
this
.
$emit
(
'save'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'save'
,
data
:
data
});
});
if
(
showResultInfo
)
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
data
.
srfmajortext
?
data
.
srfmajortext
:
''
)
+
' 保存成功!'
});
}
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
})
}
}
/**
/**
...
@@ -884,7 +710,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -884,7 +710,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @param {string[]} updateDetails 更新项
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @returns {void}
* @memberof Default
* @memberof Default
Base
*/
*/
protected
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
protected
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
...
@@ -894,28 +720,34 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -894,28 +720,34 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 回车事件
* 回车事件
*
*
* @param {*} $event
* @param {*} $event
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onEnter
(
$event
:
any
):
void
{
protected
onEnter
(
$event
:
any
):
void
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'load'
,
this
.
data
);
this
.
$emit
(
'load'
,
this
.
data
);
}
}
/**
/**
* 搜索
* 搜索
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onSearch
()
{
protected
onSearch
()
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'load'
,
this
.
data
);
this
.
$emit
(
'load'
,
this
.
data
);
}
}
/**
/**
* 重置
* 重置
*
*
* @memberof Default
* @memberof Default
Base
*/
*/
protected
onReset
()
{
protected
onReset
()
{
this
.
loadDraft
();
this
.
loadDraft
(
{},
'RESET'
);
}
}
}
}
</
script
>
</
script
>
...
...
app_web/src/widgets/ibzdict/main-grid/main-grid-base.vue
浏览文件 @
a60d5573
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<
template
v-if=
"getColumnState('updatedate')"
>
<
template
v-if=
"getColumnState('updatedate')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'updatedate'"
:label=
"$t('ibzdict.main_grid.columns.updatedate')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<el-table-column
show-overflow-tooltip
:prop=
"'updatedate'"
:label=
"$t('ibzdict.main_grid.columns.updatedate')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot=
"
{row,column}">
<template
v-slot=
"
{row,column}">
<
span>
{{
row
.
updatedate
}}
</span
>
<
app-format-data
format=
"%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS"
:data=
"row.updatedate"
></app-format-data
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</template>
</template>
...
...
app_web/yarn.lock
浏览文件 @
a60d5573
...
@@ -6965,7 +6965,7 @@ mockjs@^1.1.0:
...
@@ -6965,7 +6965,7 @@ mockjs@^1.1.0:
dependencies:
dependencies:
commander "*"
commander "*"
moment@2.24.0:
moment@2.24.0
, moment@^2.24.0
:
version "2.24.0"
version "2.24.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/IIBZDictItemService.java
浏览文件 @
a60d5573
...
@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
*/
public
interface
IIBZDictItemService
extends
IService
<
IBZDictItem
>{
public
interface
IIBZDictItemService
extends
IService
<
IBZDictItem
>{
IBZDictItem
get
(
String
itemId
)
;
IBZDictItem
get
(
String
key
)
;
IBZDictItem
get
(
IBZDictItem
iBZDictItem
)
;
IBZDictItem
getDraft
(
IBZDictItem
et
)
;
IBZDictItem
getDraft
(
IBZDictItem
iBZDictItem
)
;
boolean
save
(
IBZDictItem
et
)
;
boolean
checkKey
(
IBZDictItem
iBZDictItem
)
;
void
saveBatch
(
List
<
IBZDictItem
>
list
,
int
batchSize
)
;
boolean
remove
(
String
itemId
)
;
boolean
checkKey
(
IBZDictItem
et
)
;
boolean
create
(
IBZDictItem
iBZDictItem
)
;
boolean
Remove
(
String
key
)
;
boolean
update
(
IBZDictItem
iBZDictItem
)
;
void
removeBatch
(
Collection
<
String
>
idList
,
int
batchSize
)
;
boolean
create
(
IBZDictItem
et
)
;
void
createBatch
(
List
<
IBZDictItem
>
list
,
int
batchSize
)
;
boolean
update
(
IBZDictItem
et
)
;
void
updateBatch
(
List
<
IBZDictItem
>
list
,
int
batchSize
)
;
Page
<
IBZDictItem
>
searchDefault
(
IBZDictItemSearchContext
context
)
;
Page
<
IBZDictItem
>
searchDefault
(
IBZDictItemSearchContext
context
)
;
}
}
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/IIBZDictService.java
浏览文件 @
a60d5573
...
@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
*/
public
interface
IIBZDictService
extends
IService
<
IBZDict
>{
public
interface
IIBZDictService
extends
IService
<
IBZDict
>{
IBZDict
get
(
String
dictId
)
;
IBZDict
get
(
String
key
)
;
IBZDict
get
(
IBZDict
iBZDict
)
;
boolean
create
(
IBZDict
et
)
;
boolean
create
(
IBZDict
iBZDict
)
;
void
createBatch
(
List
<
IBZDict
>
list
,
int
batchSize
)
;
boolean
checkKey
(
IBZDict
iBZDict
)
;
boolean
checkKey
(
IBZDict
et
)
;
IBZDict
getDraft
(
IBZDict
iBZDict
)
;
IBZDict
getDraft
(
IBZDict
et
)
;
boolean
update
(
IBZDict
iBZDict
)
;
boolean
update
(
IBZDict
et
)
;
boolean
remove
(
String
dictId
)
;
void
updateBatch
(
List
<
IBZDict
>
list
,
int
batchSize
)
;
boolean
Remove
(
String
key
)
;
void
removeBatch
(
Collection
<
String
>
idList
,
int
batchSize
)
;
boolean
save
(
IBZDict
et
)
;
void
saveBatch
(
List
<
IBZDict
>
list
,
int
batchSize
)
;
Page
<
IBZDict
>
searchDefault
(
IBZDictSearchContext
context
)
;
Page
<
IBZDict
>
searchDefault
(
IBZDictSearchContext
context
)
;
}
}
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/impl/IBZDictItemServiceImpl.java
浏览文件 @
a60d5573
...
@@ -44,25 +44,24 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
...
@@ -44,25 +44,24 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
@Override
@Override
@Transactional
@Transactional
public
IBZDictItem
get
(
String
itemid
)
{
public
IBZDictItem
get
(
String
key
)
{
IBZDictItem
ibzdictitem
=
getById
(
itemid
);
IBZDictItem
et
=
getById
(
key
);
return
ibzdictitem
;
if
(
et
==
null
)
{
et
=
new
IBZDictItem
();
et
.
setItemid
(
key
);
}
}
return
et
;
@Override
@Transactional
public
IBZDictItem
get
(
IBZDictItem
ibzdictitem
)
{
return
null
;
}
}
@Override
@Override
public
IBZDictItem
getDraft
(
IBZDictItem
ibzdictitem
)
{
public
IBZDictItem
getDraft
(
IBZDictItem
et
)
{
return
ibzdictitem
;
return
et
;
}
}
@Override
@Override
public
boolean
checkKey
(
IBZDictItem
ibzdictitem
)
{
public
boolean
checkKey
(
IBZDictItem
et
)
{
return
true
;
return
true
;
}
}
@Override
@Override
...
@@ -75,17 +74,17 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
...
@@ -75,17 +74,17 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
}
}
@Override
@Override
@Transactional
@Transactional
public
boolean
create
(
IBZDictItem
ibzdictitem
)
{
public
boolean
create
(
IBZDictItem
et
)
{
boolean
bOk
=
false
;
boolean
ret
=
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
))
;
bOk
=
save
(
ibzdictitem
)
;
if
(!
ret
)
return
ret
;
return
bOk
;
return
ret
;
}
}
@Override
@Override
@Transactional
@Transactional
public
boolean
update
(
IBZDictItem
ibzdictitem
)
{
public
boolean
update
(
IBZDictItem
et
)
{
boolean
bOk
=
false
;
boolean
bOk
=
false
;
bOk
=
update
(
ibzdictitem
,
(
Wrapper
)
ibzdictitem
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictitemid"
,
ibzdictitem
.
getItemId
()));
bOk
=
update
(
et
,
(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictitemid"
,
et
.
getItemId
()));
return
bOk
;
return
bOk
;
}
}
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/impl/IBZDictServiceImpl.java
浏览文件 @
a60d5573
...
@@ -44,39 +44,47 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
...
@@ -44,39 +44,47 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
@Override
@Override
@Transactional
@Transactional
public
IBZDict
get
(
String
dictid
)
{
public
IBZDict
get
(
String
key
)
{
IBZDict
ibzdict
=
getById
(
dictid
);
IBZDict
et
=
getById
(
key
);
return
ibzdict
;
if
(
et
==
null
)
{
et
=
new
IBZDict
();
et
.
setDictid
(
key
);
}
}
return
et
;
@Override
@Transactional
public
IBZDict
get
(
IBZDict
ibzdict
)
{
return
null
;
}
}
@Override
@Override
@Transactional
@Transactional
public
boolean
create
(
IBZDict
ibzdict
)
{
public
boolean
create
(
IBZDict
et
)
{
boolean
bOk
=
false
;
boolean
ret
=
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
));
bOk
=
save
(
ibzdict
);
if
(!
ret
)
return
ret
;
return
bOk
;
//嵌套[字典项目]
if
(
et
.
getItems
()!=
null
){
for
(
cn
.
ibizlab
.
core
.
dict
.
domain
.
IBZDictItem
sub:
et
.
getItems
())
{
sub
.
setDictid
(
et
.
getDictid
())
}
if
(
et
.
getItems
().
size
()>
0
)
ibzdictitemService
.
createBatch
(
sub
,
500
)
;
et
.
setItems
(
null
);
}
return
ret
;
}
}
@Override
@Override
public
boolean
checkKey
(
IBZDict
ibzdic
t
)
{
public
boolean
checkKey
(
IBZDict
e
t
)
{
return
true
;
return
true
;
}
}
@Override
@Override
public
IBZDict
getDraft
(
IBZDict
ibzdic
t
)
{
public
IBZDict
getDraft
(
IBZDict
e
t
)
{
return
ibzdic
t
;
return
e
t
;
}
}
@Override
@Override
@Transactional
@Transactional
public
boolean
update
(
IBZDict
ibzdic
t
)
{
public
boolean
update
(
IBZDict
e
t
)
{
boolean
bOk
=
false
;
boolean
bOk
=
false
;
bOk
=
update
(
ibzdict
,
(
Wrapper
)
ibzdict
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictid"
,
ibzdic
t
.
getDictId
()));
bOk
=
update
(
et
,
(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictid"
,
e
t
.
getDictId
()));
return
bOk
;
return
bOk
;
}
}
@Override
@Override
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录