Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
1980d95c
Commit
1980d95c
authored
Oct 30, 2020
by
骆瑛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改对象fff管理页面
parent
736da3b1
Hide whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
2782 additions
and
5358 deletions
+2782
-5358
add.vue
pages/basicData/cache/add.vue
+11
-12
edit.vue
pages/basicData/cache/edit.vue
+5
-5
add.vue
pages/basicData/calendar/class/add.vue
+54
-31
edit.vue
pages/basicData/calendar/class/edit.vue
+69
-49
add.vue
pages/basicData/calendar/holiday/add.vue
+65
-49
add copy.vue
pages/basicData/calendar/holiday/class/add copy.vue
+46
-45
add.vue
pages/basicData/calendar/holiday/class/add.vue
+4
-4
edit.vue
pages/basicData/calendar/holiday/class/edit.vue
+38
-36
edit.vue
pages/basicData/calendar/holiday/edit.vue
+63
-56
add.vue
pages/basicData/calendar/overtime/add.vue
+68
-59
edit.vue
pages/basicData/calendar/overtime/edit.vue
+60
-54
add.vue
pages/basicData/calendar/work/add.vue
+77
-67
edit.vue
pages/basicData/calendar/work/edit.vue
+70
-66
add.vue
pages/basicData/code/add.vue
+27
-32
edit.vue
pages/basicData/code/edit.vue
+29
-34
set.vue
pages/basicData/code/set.vue
+6
-6
Addrow.vue
pages/basicData/department/Addrow.vue
+3
-7
add.vue
pages/basicData/department/add.vue
+3
-9
edit.vue
pages/basicData/department/edit.vue
+15
-18
add.vue
pages/basicData/dic/components/add.vue
+107
-0
edit.vue
pages/basicData/dic/components/edit.vue
+14
-2
index.vue
pages/basicData/dic/index.vue
+192
-70
add.vue
pages/basicData/menu/add.vue
+58
-44
addApi.vue
pages/basicData/menu/addApi.vue
+2
-2
edit.vue
pages/basicData/menu/edit.vue
+40
-36
add.vue
pages/basicData/messageConfig/add.vue
+13
-7
edit.vue
pages/basicData/messageConfig/edit.vue
+15
-9
add.vue
pages/basicData/method/add.vue
+108
-82
edit.vue
pages/basicData/method/edit.vue
+114
-87
add.vue
pages/basicData/systemUser/add.vue
+262
-230
edit.vue
pages/basicData/systemUser/edit.vue
+269
-236
add.vue
pages/basicData/user/add.vue
+28
-31
edit.vue
pages/basicData/user/edit.vue
+269
-236
add.vue
pages/exception/add.vue
+187
-132
detail.vue
pages/exception/detail.vue
+1
-7
edit.vue
pages/exception/edit.vue
+160
-108
add.vue
pages/system/data_source/add.vue
+1
-7
edit.vue
pages/system/data_source/edit.vue
+79
-74
add.vue
pages/system/project/atom/add.vue
+0
-666
api.js
pages/system/project/atom/api.js
+0
-25
detail.vue
pages/system/project/atom/detail.vue
+0
-233
index.vue
pages/system/project/atom/dtos/index.vue
+0
-406
inputDto.vue
pages/system/project/atom/dtos/inputDto.vue
+0
-0
outDto.vue
pages/system/project/atom/dtos/outDto.vue
+0
-0
edit.vue
pages/system/project/atom/edit.vue
+0
-686
index.vue
pages/system/project/atom/index.vue
+0
-224
search.vue
pages/system/project/atom/search.vue
+0
-141
index.vue
pages/system/project/index.vue
+0
-39
add.vue
pages/system/project/project/add.vue
+0
-134
api.js
pages/system/project/project/api.js
+0
-25
detail.vue
pages/system/project/project/detail.vue
+0
-64
edit.vue
pages/system/project/project/edit.vue
+0
-141
index.vue
pages/system/project/project/index.vue
+0
-265
search.vue
pages/system/project/project/search.vue
+0
-131
add.vue
pages/test/Message/add.vue
+72
-67
edit.vue
pages/test/Message/edit.vue
+78
-72
No files found.
pages/basicData/cache/add.vue
View file @
1980d95c
...
...
@@ -3,15 +3,18 @@
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem></Col>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem></Col>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('duration')"
prop=
"duration"
>
<InputNumber
v-model=
"entity.duration"
></InputNumber>
</FormItem>
</Col>
<InputNumber
v-model=
"entity.duration"
></InputNumber>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('strategy')"
prop=
"strategy"
>
<Dictionary
...
...
@@ -43,9 +46,7 @@
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -56,7 +57,6 @@ export default {
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
code
:
""
,
name
:
""
,
...
...
@@ -69,7 +69,9 @@ export default {
rules
:
{
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
duration
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
type
:
"number"
}],
duration
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
type
:
"number"
},
],
},
};
},
...
...
@@ -86,10 +88,8 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -98,7 +98,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
pages/basicData/cache/edit.vue
View file @
1980d95c
...
...
@@ -45,7 +45,7 @@
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
...
...
@@ -58,7 +58,7 @@ export default {
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
...
...
@@ -84,10 +84,10 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -96,7 +96,7 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
pages/basicData/calendar/class/add.vue
View file @
1980d95c
...
...
@@ -3,17 +3,31 @@
<Row>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftWorkSchedCode')"
prop=
"shiftWorkSchedCode"
>
<Input
v-model=
"entity.shiftWorkSchedCode"
placeholder=
"请填写班次编号"
style=
"width: 90%"
></Input>
<Input
v-model=
"entity.shiftWorkSchedCode"
placeholder=
"请填写班次编号"
style=
"width: 90%"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftName')"
prop=
"shiftName"
>
<Input
v-model=
"entity.shiftName"
placeholder=
"请填写班次名称"
style=
"width: 90%"
></Input>
<Input
v-model=
"entity.shiftName"
placeholder=
"请填写班次名称"
style=
"width: 90%"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftStartEnd')"
prop=
"shiftStartEnd"
>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStartEnd"
type=
"timerange"
placeholder=
"请选择时间段"
style=
"width: 130px"
></TimePicker>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStartEnd"
type=
"timerange"
placeholder=
"请选择时间段"
style=
"width: 130px"
></TimePicker>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
...
...
@@ -28,7 +42,7 @@
</Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -39,39 +53,49 @@ export default {
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
shiftWorkSchedCode
:
[{
required
:
true
,
message
:
"请填写班次编号"
,
trigger
:
"blur"
}],
shiftName
:
[{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
}],
shiftStartEnd
:
[{
required
:
true
,
type
:
'array'
,
message
:
"请选择班次时间段"
,
trigger
:
'blur'
,
fields
:
{
0
:
{
type
:
"string"
,
required
:
true
,
message
:
"请选择班次时间段"
},
1
:
{
type
:
"string"
,
required
:
true
,
message
:
"请选择班次时间段"
}
}
}
shiftWorkSchedCode
:
[
{
required
:
true
,
message
:
"请填写班次编号"
,
trigger
:
"blur"
},
],
}
shiftName
:
[
{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
},
],
shiftStartEnd
:
[
{
required
:
true
,
type
:
"array"
,
message
:
"请选择班次时间段"
,
trigger
:
"blur"
,
fields
:
{
0
:
{
type
:
"string"
,
required
:
true
,
message
:
"请选择班次时间段"
,
},
1
:
{
type
:
"string"
,
required
:
true
,
message
:
"请选择班次时间段"
,
},
},
},
],
},
};
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
this
.
$refs
.
form
.
validate
(
(
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
var
data
=
this
.
$u
.
clone
(
this
.
entity
)
data
.
shiftStart
=
this
.
entity
.
shiftStartEnd
[
0
]
data
.
shiftEnd
=
this
.
entity
.
shiftStartEnd
[
1
]
var
data
=
this
.
$u
.
clone
(
this
.
entity
);
data
.
shiftStart
=
this
.
entity
.
shiftStartEnd
[
0
];
data
.
shiftEnd
=
this
.
entity
.
shiftStartEnd
[
1
];
Api
.
create
(
data
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -79,8 +103,7 @@ export default {
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
@@ -93,12 +116,12 @@ export default {
l
(
key
)
{
key
=
"mes_shift_work_sched"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
}
}
}
,
}
,
};
</
script
>
pages/basicData/calendar/class/edit.vue
View file @
1980d95c
...
...
@@ -11,24 +11,40 @@
<Input
v-model=
"entity.shiftName"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftStartEnd')"
prop=
"shiftStartEnd"
>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStartEnd"
type=
"timerange"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStartEnd"
type=
"timerange"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftStart')"
prop=
"shiftStart"
>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStart"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftStart"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('shiftEnd')"
prop=
"shiftEnd"
>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftEnd"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
<TimePicker
format=
"HH:mm"
v-model=
"entity.shiftEnd"
placeholder=
"选择时间段"
style=
"width: 130px"
></TimePicker>
</FormItem>
</Col>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -39,61 +55,65 @@ export default {
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
shiftWorkSchedCode
:
[{
required
:
true
,
message
:
"请填写班次编号"
,
trigger
:
"blur"
}],
shiftName
:
[{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
}],
shiftStart
:
[{
required
:
true
,
message
:
"请选择开始时间"
,
trigger
:
"change"
}],
shiftEnd
:
[{
required
:
true
,
message
:
"请选择结束时间"
,
trigger
:
"change"
}],
}
shiftWorkSchedCode
:
[
{
required
:
true
,
message
:
"请填写班次编号"
,
trigger
:
"blur"
},
],
shiftName
:
[
{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
},
],
shiftStart
:
[
{
required
:
true
,
message
:
"请选择开始时间"
,
trigger
:
"change"
,
},
],
shiftEnd
:
[
{
required
:
true
,
message
:
"请选择结束时间"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
eid
:
Number
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
Api
.
get
({
id
:
v
}).
then
(
(
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
this
.
$refs
.
form
.
validate
(
(
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
var
data
=
this
.
entity
let
startime
=
data
.
shiftStart
let
endtime
=
data
.
shiftEnd
if
(
startime
>
endtime
){
alert
(
"结束时间不能小于开始时间!"
);
this
.
disabled
=
false
;
return
;
}
else
{
Api
.
update
(
data
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
var
data
=
this
.
entity
;
let
startime
=
data
.
shiftStart
;
let
endtime
=
data
.
shiftEnd
;
if
(
startime
>
endtime
)
{
alert
(
"结束时间不能小于开始时间!"
);
return
;
}
else
{
Api
.
update
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
console
.
warn
(
err
);
});
}
}
});
...
...
@@ -104,14 +124,14 @@ export default {
l
(
key
)
{
key
=
"mes_shift_work_sched"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/basicData/calendar/holiday/add.vue
View file @
1980d95c
...
...
@@ -3,12 +3,20 @@
<Row>
<Col
:span=
"24"
>
<FormItem
:label=
"l('holidayId')"
prop=
"holidayId"
>
<Input
v-model=
"entity.holidayId"
placeholder=
"请填写节假日编号"
style=
"width: 90%"
></Input>
<Input
v-model=
"entity.holidayId"
placeholder=
"请填写节假日编号"
style=
"width: 90%"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('holidayName')"
prop=
"holidayName"
>
<Input
v-model=
"entity.holidayName"
placeholder=
"请填写节假日名称"
style=
"width: 90%"
></Input>
<Input
v-model=
"entity.holidayName"
placeholder=
"请填写节假日名称"
style=
"width: 90%"
></Input>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
...
...
@@ -24,17 +32,25 @@
</Col>
-->
<Col
:span=
"24"
>
<FormItem
:label=
"l('holidayStart')"
prop=
"holidayStart"
>
<DatePicker
type=
"date"
placeholder=
"请选择开始日期"
v-model=
"entity.holidayStart"
></DatePicker>
<DatePicker
type=
"date"
placeholder=
"请选择开始日期"
v-model=
"entity.holidayStart"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('holidayEnd')"
prop=
"holidayEnd"
>
<DatePicker
type=
"date"
placeholder=
"请选择结束日期"
v-model=
"entity.holidayEnd"
></DatePicker>
<DatePicker
type=
"date"
placeholder=
"请选择结束日期"
v-model=
"entity.holidayEnd"
></DatePicker>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -45,27 +61,30 @@ export default {
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
holidayId
:
[
{
required
:
true
,
message
:
"请填写节假日编号"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请填写节假日编号"
,
trigger
:
"blur"
}
,
],
holidayName
:
[
{
required
:
true
,
message
:
"请填写节假日名称"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请填写节假日名称"
,
trigger
:
"blur"
},
],
holidayStart
:
[
{
required
:
true
,
type
:
"date"
,
message
:
"请选择开始时间"
,
trigger
:
"change"
,
},
],
holidayEnd
:
[
{
required
:
true
,
type
:
"date"
,
message
:
"请选择结束时间"
,
trigger
:
"change"
,
},
],
holidayStart
:
[{
required
:
true
,
type
:
"date"
,
message
:
"请选择开始时间"
,
trigger
:
"change"
}],
holidayEnd
:
[{
required
:
true
,
type
:
"date"
,
message
:
"请选择结束时间"
,
trigger
:
"change"
}],
// holidayTimeslot: [
// {
// required: true,
...
...
@@ -77,41 +96,38 @@ export default {
// 1: {type: "date", required: true, message: "请选择班次时间段"}
// }
// }
// ]
}
}
,
};
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
this
.
$refs
.
form
.
validate
(
(
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
let
startime
=
this
.
entity
.
holidayStart
let
endtime
=
this
.
entity
.
holidayEnd
if
(
startime
.
getTime
()
>
endtime
.
getTime
()){
alert
(
"结束时间不能大于开始时间!"
);
this
.
disabled
=
false
;
return
;
}
else
{
Api
.
create
(
this
.
entity
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
let
startime
=
this
.
entity
.
holidayStart
;
let
endtime
=
this
.
entity
.
holidayEnd
;
if
(
startime
.
getTime
()
>
endtime
.
getTime
())
{
this
.
$Message
.
error
(
"结束时间不能大于开始时间!"
);
return
;
}
else
{
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
console
.
warn
(
err
);
});
}
}
});
...
...
@@ -122,12 +138,12 @@ export default {
l
(
key
)
{
key
=
"calendar_holiday"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/basicData/calendar/holiday/class/add copy.vue
View file @
1980d95c
...
...
@@ -23,33 +23,35 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
shiftWorkSchedCode
:
[{
required
:
true
,
message
:
'请填写编号'
,
trigger
:
'blur'
}],
shiftName
:
[{
required
:
true
,
message
:
'请填写班次名称'
,
trigger
:
'blur'
}],
}
}
shiftWorkSchedCode
:
[
{
required
:
true
,
message
:
"请填写编号"
,
trigger
:
"blur"
},
],
shiftName
:
[
{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
},
],
},
};
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
// let parmes = {
// pageIndex: 1,
// pageSize: 20,
...
...
@@ -61,52 +63,51 @@ export default {
// }
// ],
// total: 4
// }
// }
// Api.paged(parmes).then((r) => {
// console.log(r.success)
// if(r.success){
// this.$Message.error("该班次名称已存在!")
// this.disabled = true
// return
// }else{
let
pames
=
{
title
:
this
.
entity
.
title
,
startendTime
:
this
.
entity
.
startendTime
.
join
(
'-'
)
}
Api
.
create
(
pames
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
// this.disabled = false
this
.
$Message
.
success
(
'保存成功'
)
this
.
entity
=
{}
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
// }
// })
let
pames
=
{
title
:
this
.
entity
.
title
,
startendTime
:
this
.
entity
.
startendTime
.
join
(
"-"
),
};
Api
.
create
(
pames
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
entity
=
{};
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
// }
// })
},
handleClose
()
{
this
.
entity
=
{}
this
.
disabled
=
true
this
.
$emit
(
'on-close'
)
this
.
entity
=
{}
;
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'calendar_class'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_class"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
}
}
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
;
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/holiday/class/add.vue
View file @
1980d95c
...
...
@@ -23,7 +23,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -34,7 +34,7 @@ export default {
name
:
'Add'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
shiftWorkSchedCode
:
[{
required
:
true
,
message
:
'请填写编号'
,
trigger
:
'blur'
}],
...
...
@@ -49,7 +49,7 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
// let parmes = {
// pageIndex: 1,
// pageSize: 20,
...
...
@@ -95,7 +95,7 @@ export default {
},
handleClose
()
{
this
.
entity
=
{}
this
.
disabled
=
true
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
...
...
pages/basicData/calendar/holiday/class/edit.vue
View file @
1980d95c
...
...
@@ -6,88 +6,90 @@
<Input
v-model=
"entity.title"
></Input>
</FormItem>
</Col>
<Col
span=
"24"
>
<!-- prop="startendTime" -->
<Col
span=
"24"
>
<!-- prop="startendTime" -->
<FormItem
:label=
"l('startendTime')"
>
<TimePicker
type=
"timerange"
format=
"HH:mm"
v-model=
"entity.startendTime"
placeholder=
"请选择时间段"
></TimePicker>
<TimePicker
type=
"timerange"
format=
"HH:mm"
v-model=
"entity.startendTime"
placeholder=
"请选择时间段"
></TimePicker>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
title
:
[{
required
:
true
,
message
:
'请填写班次名称'
,
trigger
:
'blur'
}],
title
:
[{
required
:
true
,
message
:
"请填写班次名称"
,
trigger
:
"blur"
}],
// startendTime: [{ required: true, message: '请选择时间段', trigger: 'blur' }],
}
}
}
,
}
;
},
props
:
{
eid
:
Number
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
r
.
result
.
startendTime
=
r
.
result
.
startendTime
.
split
(
'-'
)
this
.
entity
=
r
.
result
this
.
$emit
(
'on-load'
)
})
r
.
result
.
startendTime
=
r
.
result
.
startendTime
.
split
(
"-"
);
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
})
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
let
startendTime
=
this
.
entity
.
startendTime
let
pames
=
{
let
startendTime
=
this
.
entity
.
startendTime
;
let
pames
=
{
title
:
this
.
entity
.
title
,
startendTime
:
startendTime
.
join
(
'-'
),
startendTime
:
startendTime
.
join
(
"-"
),
workHours
:
this
.
entity
.
workHours
,
creationTime
:
this
.
entity
.
creationTime
,
creatorUserId
:
this
.
entity
.
creatorUserId
,
id
:
this
.
entity
.
id
,
}
}
;
Api
.
update
(
pames
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
// console.warn(err)
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'calendar_class'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_class"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/holiday/edit.vue
View file @
1980d95c
...
...
@@ -23,91 +23,98 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
holidayId
:
[{
required
:
true
,
message
:
'请填写节假日编号'
,
trigger
:
'blur'
}],
holidayName
:
[{
required
:
true
,
message
:
'请填写节假日名称'
,
trigger
:
'blur'
}],
holidayStart
:
[{
required
:
true
,
type
:
"date"
,
message
:
"请选择开始时间"
,
trigger
:
"change"
}],
holidayEnd
:
[{
required
:
true
,
type
:
"date"
,
message
:
"请选择结束时间"
,
trigger
:
"change"
}],
}
}
holidayId
:
[
{
required
:
true
,
message
:
"请填写节假日编号"
,
trigger
:
"blur"
},
],
holidayName
:
[
{
required
:
true
,
message
:
"请填写节假日名称"
,
trigger
:
"blur"
},
],
holidayStart
:
[
{
required
:
true
,
type
:
"date"
,
message
:
"请选择开始时间"
,
trigger
:
"change"
,
},
],
holidayEnd
:
[
{
required
:
true
,
type
:
"date"
,
message
:
"请选择结束时间"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
eid
:
Number
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
this
.
$emit
(
'on-load'
)
})
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
})
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
let
startime
=
this
.
entity
.
holidayStart
let
endtime
=
this
.
entity
.
holidayEnd
if
(
startime
.
getTime
()
>
endtime
.
getTime
()){
alert
(
"结束时间不能小于开始时间!"
);
this
.
disabled
=
false
;
return
;
}
else
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
let
startime
=
this
.
entity
.
holidayStart
;
let
endtime
=
this
.
entity
.
holidayEnd
;
if
(
startime
.
getTime
()
>
endtime
.
getTime
())
{
this
.
$Message
.
error
(
"结束时间不能小于开始时间!"
);
return
;
}
else
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'calendar_holiday'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_holiday"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/overtime/add.vue
View file @
1980d95c
...
...
@@ -18,113 +18,122 @@
v-for=
"item in orderCatList"
:value=
"item.id"
:key=
"item.index"
:label=
"item.title
+'('+ item.startendTime +
')'"
:label=
"item.title
+ '(' + item.startendTime +
')'"
></Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
id
:[],
title
:
""
,
holidayId
:[],
holidayTitle
:
""
,
selectItems
:
[],
//选中的加班日历
id
:
[],
title
:
""
,
holidayId
:
[],
holidayTitle
:
""
,
selectItems
:
[],
//选中的加班日历
},
orderCatList
:
[],
rules
:
{
holidayCalId
:
[{
required
:
true
,
message
:
'请填写日历编号'
,
trigger
:
'blur'
}],
holidayCalName
:
[{
required
:
true
,
message
:
'请填写日历名称'
,
trigger
:
'blur'
}],
holidayCalId
:
[
{
required
:
true
,
message
:
"请填写日历编号"
,
trigger
:
"blur"
},
],
holidayCalName
:
[
{
required
:
true
,
message
:
"请填写日历名称"
,
trigger
:
"blur"
},
],
holidayId
:
[
{
required
:
true
,
type
:
'array'
,
min
:
1
,
message
:
'请选择关联假日'
,
trigger
:
'change'
},
]
}
}
{
required
:
true
,
type
:
"array"
,
min
:
1
,
message
:
"请选择关联假日"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
v
:
Object
v
:
Object
,
},
created
()
{
this
.
selectAry
()
this
.
selectAry
()
;
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
let
titles
=
[];
this
.
selectItems
.
map
(
u
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
)
})
let
titles
=
[];
this
.
selectItems
.
map
((
u
)
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
);
});
let
parme
=
{
holidayCalId
:
this
.
entity
.
holidayCalId
,
holidayCalName
:
this
.
entity
.
holidayCalName
,
mesHolidayTitles
:
titles
.
join
(),
mesHolidayIds
:
this
.
entity
.
holidayId
.
join
(),
}
Api
.
create
(
parme
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
holidayCalId
:
this
.
entity
.
holidayCalId
,
holidayCalName
:
this
.
entity
.
holidayCalName
,
mesHolidayTitles
:
titles
.
join
(),
mesHolidayIds
:
this
.
entity
.
holidayId
.
join
(),
}
;
Api
.
create
(
parme
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
entity
.
holidayId
=
[];
this
.
$Message
.
success
(
"保存成功"
);
this
.
entity
.
holidayId
=
[];
this
.
$refs
.
form
.
resetFields
();
this
.
$emit
(
'on-ok'
)
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
selectAry
()
{
Api
.
getlist
().
then
((
res
)
=>
{
console
.
log
(
"加班日历"
,
res
)
this
.
orderCatList
=
res
.
result
})
console
.
log
(
"加班日历"
,
res
);
this
.
orderCatList
=
res
.
result
;
})
;
},
getItems
(
v
){
//获取所有选中项;
var
items
=
this
.
orderCatList
.
filter
(
u
=>
{
return
v
.
indexOf
(
u
.
id
)
>-
1
})
this
.
selectItems
=
items
;
getItems
(
v
)
{
//获取所有选中项;
var
items
=
this
.
orderCatList
.
filter
((
u
)
=>
{
return
v
.
indexOf
(
u
.
id
)
>
-
1
;
});
this
.
selectItems
=
items
;
},
getHours
(){
//获取工时
let
sum
=
0
;
this
.
selectItems
.
map
(
u
=>
{
sum
+=
u
.
workHours
;
getHours
()
{
//获取工时
let
sum
=
0
;
this
.
selectItems
.
map
((
u
)
=>
{
sum
+=
u
.
workHours
;
});
return
sum
;
},
l
(
key
)
{
key
=
'calendar_overtime'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_overtime"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
}
}
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
;
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/overtime/edit.vue
View file @
1980d95c
...
...
@@ -18,116 +18,122 @@
v-for=
"item in orderCatList"
:value=
"item.id"
:key=
"item.index"
:label=
"item.title
+'('+ item.startendTime +
')'"
:label=
"item.title
+ '(' + item.startendTime +
')'"
></Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
selectItems
:
[],
//选中的加班日历
orderCatList
:
[],
rules
:
{
holidayCalId
:
[{
required
:
true
,
message
:
'请填写日历编号'
,
trigger
:
'blur'
}],
holidayCalName
:
[{
required
:
true
,
message
:
'请填写日历名称'
,
trigger
:
'blur'
}],
holidayCalId
:
[
{
required
:
true
,
message
:
"请填写日历编号"
,
trigger
:
"blur"
},
],
holidayCalName
:
[
{
required
:
true
,
message
:
"请填写日历名称"
,
trigger
:
"blur"
},
],
classId
:
[
{
required
:
true
,
type
:
'array'
,
min
:
1
,
message
:
'请选择关联节日'
,
trigger
:
'change'
},
]
}
}
{
required
:
true
,
type
:
"array"
,
min
:
1
,
message
:
"请选择关联节日"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
eid
:
Number
eid
:
Number
,
},
created
()
{
this
.
selectAry
()
this
.
selectAry
()
;
},
methods
:
{
selectAry
()
{
Api
.
getlist
().
then
((
res
)
=>
{
this
.
orderCatList
=
res
.
result
})
this
.
orderCatList
=
res
.
result
;
})
;
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
let
dataForm
=
r
.
result
let
dataForm
=
r
.
result
;
if
(
dataForm
.
mesHolidayIds
)
{
let
ids
=
dataForm
.
mesHolidayIds
.
split
(
','
)
var
uids
=
[]
let
ids
=
dataForm
.
mesHolidayIds
.
split
(
","
);
var
uids
=
[]
;
ids
.
map
((
u
)
=>
{
uids
.
push
(
parseInt
(
u
))
})
this
.
getItems
(
uids
)
dataForm
.
classId
=
uids
uids
.
push
(
parseInt
(
u
))
;
})
;
this
.
getItems
(
uids
)
;
dataForm
.
classId
=
uids
;
}
else
{
dataForm
.
classId
=
[]
dataForm
.
classId
=
[]
;
}
this
.
entity
=
dataForm
this
.
$emit
(
'on-load'
)
})
this
.
entity
=
dataForm
;
this
.
$emit
(
"on-load"
);
})
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
let
titles
=
[]
let
titles
=
[];
this
.
selectItems
.
map
((
u
)
=>
{
titles
.
push
(
u
.
title
+
'('
+
u
.
startendTime
+
')'
)
})
var
data
=
this
.
$u
.
clone
(
this
.
entity
)
data
.
mesHolidayTitles
=
titles
.
join
()
data
.
mesHolidayIds
=
this
.
entity
.
classId
.
join
()
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
);
})
;
var
data
=
this
.
$u
.
clone
(
this
.
entity
)
;
data
.
mesHolidayTitles
=
titles
.
join
()
;
data
.
mesHolidayIds
=
this
.
entity
.
classId
.
join
()
;
Api
.
update
(
data
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
getItems
(
v
)
{
var
items
=
this
.
orderCatList
.
filter
((
u
)
=>
{
return
v
.
indexOf
(
u
.
id
)
>
-
1
})
this
.
selectItems
=
items
var
items
=
this
.
orderCatList
.
filter
((
u
)
=>
{
return
v
.
indexOf
(
u
.
id
)
>
-
1
;
});
this
.
selectItems
=
items
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'calendar_overtime'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_overtime"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/work/add.vue
View file @
1980d95c
...
...
@@ -13,134 +13,144 @@
</Col>
<Col
span=
"24"
>
<FormItem
:label=
"l('shiftName')"
prop=
"mesShiftWorkSchedIds"
>
<Select
v-model=
"entity.mesShiftWorkSchedIds"
multiple
@
on-change=
"getItems"
>
<Select
v-model=
"entity.mesShiftWorkSchedIds"
multiple
@
on-change=
"getItems"
>
<Option
v-for=
"item in orderCatList"
:value=
"item.id"
:key=
"item.index"
:label=
"item.title
+'('+ item.startendTime +
')'"
:label=
"item.title
+ '(' + item.startendTime +
')'"
></Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
orderCatList
:
[],
multipleFlag
:
false
,
vlableLis
:
[],
sum
:
0
,
idList
:
[],
titleClass
:
''
,
titleClass02
:
''
,
vlableLis
:
[],
sum
:
0
,
idList
:
[],
titleClass
:
""
,
titleClass02
:
""
,
entity
:
{
id
:[],
title
:
""
,
mesShiftWorkSchedIds
:[],
calendarClassTitle
:
""
,
workHours
:
0
id
:
[],
title
:
""
,
mesShiftWorkSchedIds
:
[],
calendarClassTitle
:
""
,
workHours
:
0
,
},
selectItems
:
[],
//选中的加班日历
selectItems
:
[],
//选中的加班日历
rules
:
{
calId
:
[{
required
:
true
,
message
:
'请填写日历编号'
,
trigger
:
'blur'
}],
calName
:
[{
required
:
true
,
message
:
'请填写日历名称'
,
trigger
:
'blur'
}],
calId
:
[{
required
:
true
,
message
:
"请填写日历编号"
,
trigger
:
"blur"
}],
calName
:
[
{
required
:
true
,
message
:
"请填写日历名称"
,
trigger
:
"blur"
},
],
mesShiftWorkSchedIds
:
[
{
required
:
true
,
type
:
'array'
,
min
:
1
,
message
:
'请选择关联班次'
,
trigger
:
'change'
},
]
}
}
{
required
:
true
,
type
:
"array"
,
min
:
1
,
message
:
"请选择关联班次"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
v
:
Object
v
:
Object
,
},
created
()
{
this
.
selectAry
()
this
.
selectAry
()
;
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
let
titles
=
[];
this
.
selectItems
.
map
(
u
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
)
})
let
titles
=
[];
this
.
selectItems
.
map
((
u
)
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
);
});
let
parme
=
{
calId
:
this
.
entity
.
calId
,
calName
:
this
.
entity
.
calName
,
shiftName
:
titles
.
join
(),
mesShiftWorkSchedIds
:
this
.
entity
.
mesShiftWorkSchedIds
.
join
(),
workingLong
:
this
.
getHours
()
}
calId
:
this
.
entity
.
calId
,
calName
:
this
.
entity
.
calName
,
shiftName
:
titles
.
join
(),
mesShiftWorkSchedIds
:
this
.
entity
.
mesShiftWorkSchedIds
.
join
(),
workingLong
:
this
.
getHours
(),
}
;
Api
.
create
(
parme
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
entity
.
mesShiftWorkSchedIds
=
[];
this
.
$Message
.
success
(
"保存成功"
);
this
.
entity
.
mesShiftWorkSchedIds
=
[];
this
.
$refs
.
form
.
resetFields
();
this
.
$emit
(
'on-ok'
)
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
// this.orderCatList = []
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
selectAry
()
{
let
parmse
=
{
pageIndex
:
0
,
cont
:
0
,
conditions
:
[],
pageSize
:
20
}
pageSize
:
20
,
}
;
Api
.
getlist
().
then
((
res
)
=>
{
// console.log("工作日历",res)
this
.
orderCatList
=
res
.
result
})
this
.
orderCatList
=
res
.
result
;
})
;
},
getItems
(
v
){
//获取所有选中项;
var
items
=
this
.
orderCatList
.
filter
(
u
=>
{
return
v
.
indexOf
(
u
.
id
)
>-
1
})
this
.
selectItems
=
items
;
getItems
(
v
)
{
//获取所有选中项;
var
items
=
this
.
orderCatList
.
filter
((
u
)
=>
{
return
v
.
indexOf
(
u
.
id
)
>
-
1
;
});
this
.
selectItems
=
items
;
},
getHours
(){
//获取工时
let
sum
=
0
;
this
.
selectItems
.
map
(
u
=>
{
sum
+=
u
.
workHours
;
getHours
()
{
//获取工时
let
sum
=
0
;
this
.
selectItems
.
map
((
u
)
=>
{
sum
+=
u
.
workHours
;
});
return
sum
;
},
l
(
key
)
{
key
=
'calendar_work'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_work"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
}
}
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
;
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/calendar/work/edit.vue
View file @
1980d95c
...
...
@@ -18,130 +18,134 @@
v-for=
"item in orderCatList"
:value=
"item.id"
:key=
"item.index"
:label=
"item.title
+'('+ item.startendTime +
')'"
:label=
"item.title
+ '(' + item.startendTime +
')'"
></Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
orderCatList
:
[],
selectItems
:
[],
//选中的加班日历
rules
:
{
calId
:
[{
required
:
true
,
message
:
'请填写日历编号'
,
trigger
:
'blur'
}],
calName
:
[{
required
:
true
,
message
:
'请填写日历名称'
,
trigger
:
'blur'
}],
calId
:
[{
required
:
true
,
message
:
"请填写日历编号"
,
trigger
:
"blur"
}],
calName
:
[
{
required
:
true
,
message
:
"请填写日历名称"
,
trigger
:
"blur"
},
],
classId
:
[
{
required
:
true
,
type
:
'array'
,
min
:
1
,
message
:
'请选择关联班次'
,
trigger
:
'change'
},
]
}
}
{
required
:
true
,
type
:
"array"
,
min
:
1
,
message
:
"请选择关联班次"
,
trigger
:
"change"
,
},
],
},
};
},
props
:
{
eid
:
Number
eid
:
Number
,
},
created
()
{
this
.
selectList
()
this
.
selectList
()
;
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
let
dataForm
=
r
.
result
if
(
dataForm
.
mesShiftWorkSchedIds
){
let
ids
=
dataForm
.
mesShiftWorkSchedIds
.
split
(
','
)
var
uids
=
[];
ids
.
map
(
u
=>
{
uids
.
push
(
parseInt
(
u
))
})
console
.
warn
(
uids
)
let
dataForm
=
r
.
result
;
if
(
dataForm
.
mesShiftWorkSchedIds
)
{
let
ids
=
dataForm
.
mesShiftWorkSchedIds
.
split
(
","
);
var
uids
=
[];
ids
.
map
(
(
u
)
=>
{
uids
.
push
(
parseInt
(
u
))
;
})
;
console
.
warn
(
uids
)
;
this
.
getItems
(
uids
);
dataForm
.
classId
=
uids
;
}
else
{
dataForm
.
classId
=
[];
}
this
.
entity
=
dataForm
this
.
$emit
(
'on-load'
)
})
dataForm
.
classId
=
uids
;
}
else
{
dataForm
.
classId
=
[];
}
this
.
entity
=
dataForm
;
this
.
$emit
(
"on-load"
);
})
;
},
selectList
()
{
Api
.
getlist
().
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
orderCatList
=
res
.
result
})
console
.
log
(
res
)
;
this
.
orderCatList
=
res
.
result
;
})
;
},
getItems
(
v
)
{
//获取所有选中项;
var
items
=
this
.
orderCatList
.
filter
((
u
)
=>
{
console
.
log
(
u
.
id
)
return
v
.
indexOf
(
u
.
id
)
>
-
1
})
this
.
selectItems
=
items
console
.
log
(
this
.
selectItems
)
console
.
log
(
u
.
id
)
;
return
v
.
indexOf
(
u
.
id
)
>
-
1
;
})
;
this
.
selectItems
=
items
;
console
.
log
(
this
.
selectItems
)
;
},
getHours
()
{
let
sum
=
0
let
sum
=
0
;
this
.
selectItems
.
map
((
u
)
=>
{
sum
+=
u
.
workHours
})
return
sum
sum
+=
u
.
workHours
;
})
;
return
sum
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
let
titles
=
[];
this
.
selectItems
.
map
(
u
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
)
})
this
.
entity
.
shiftName
=
titles
.
join
();
var
data
=
this
.
$u
.
clone
(
this
.
entity
);
data
.
mesShiftWorkSchedIds
=
this
.
entity
.
classId
.
join
();
data
.
workingLong
=
this
.
getHours
();
let
titles
=
[];
this
.
selectItems
.
map
((
u
)
=>
{
titles
.
push
(
u
.
title
+
"("
+
u
.
startendTime
+
")"
);
});
this
.
entity
.
shiftName
=
titles
.
join
();
var
data
=
this
.
$u
.
clone
(
this
.
entity
);
data
.
mesShiftWorkSchedIds
=
this
.
entity
.
classId
.
join
();
data
.
workingLong
=
this
.
getHours
();
Api
.
update
(
data
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
);
this
.
$emit
(
'on-ok'
)
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'calendar_work'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"calendar_work"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/code/add.vue
View file @
1980d95c
...
...
@@ -37,69 +37,64 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
day
:
'1'
,
maxSerial
:
0
day
:
"1"
,
maxSerial
:
0
,
},
rules
:
{
businessName
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
businessCode
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
businessName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
businessCode
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
}
,
}
;
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
entity
=
{}
this
.
entity
.
maxSerial
=
0
;
this
.
disabled
=
false
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
this
.
entity
=
{};
this
.
entity
.
maxSerial
=
0
;
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
disabled
=
false
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'business_code_config'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"business_code_config"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
}
}
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
;
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/code/edit.vue
View file @
1980d95c
...
...
@@ -26,7 +26,7 @@
<FormItem
:label=
"l('day')"
prop=
"day"
>
<Dictionary
code=
"mes_xingchi_system.business_code_config.day"
:value=
'entity.day'
:value=
"entity.day"
:key=
"entity.day"
v-model=
"entity.day"
type=
"radio"
...
...
@@ -40,75 +40,70 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
color
:
''
color
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
}
,
}
;
},
props
:
{
eid
:
Number
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
this
.
entity
.
day
=
this
.
entity
.
day
this
.
$emit
(
'on-load'
)
})
this
.
entity
=
r
.
result
;
this
.
entity
.
day
=
this
.
entity
.
day
;
this
.
$emit
(
"on-load"
);
})
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
disabled
=
false
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'business_code_config'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"business_code_config"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
this
.
disabled
=
false
;
}
}
}
},
},
};
</
script
>
\ No newline at end of file
pages/basicData/code/set.vue
View file @
1980d95c
...
...
@@ -22,7 +22,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -34,7 +34,7 @@ export default {
name
:
'Edit'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
tishi
:
''
,
rules
:
{
...
...
@@ -59,7 +59,7 @@ export default {
this
.
entity
.
day
=
this
.
entity
.
day
+
''
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
Api
.
setrule
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
...
...
@@ -67,11 +67,11 @@ export default {
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
disabled
=
false
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
...
...
@@ -91,7 +91,7 @@ export default {
if
(
v
!=
0
)
{
this
.
load
(
v
)
}
this
.
disabled
=
false
},
'entity.day'
:
{
handler
(
newValue
,
oldValue
)
{
...
...
pages/basicData/department/Addrow.vue
View file @
1980d95c
...
...
@@ -43,9 +43,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<!-- 组织类型 -->
...
...
@@ -69,7 +67,7 @@ export default {
return
callback
(
new
Error
(
"编号不能为空"
));
}
Api
.
isExist
(
value
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
if
(
r
.
result
)
{
return
callback
(
new
Error
(
"编号已经存在"
));
}
else
{
callback
();
...
...
@@ -78,7 +76,7 @@ export default {
};
return
{
// showTree: false, //组织类型
disabled
:
false
,
citys
:
citys
(),
entity
:
{
id
:
0
,
...
...
@@ -149,7 +147,6 @@ export default {
Api
.
create
(
paramsdata
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -158,7 +155,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
}
...
...
pages/basicData/department/add.vue
View file @
1980d95c
...
...
@@ -39,9 +39,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<!-- 组织类型 -->
...
...
@@ -74,7 +72,7 @@ export default {
};
return
{
// showTree: false, //组织类型
disabled
:
false
,
citys
:
citys
(),
entity
:
{
organization_Id
:
0
,
...
...
@@ -85,9 +83,7 @@ export default {
property
:
[],
location
:
[],
rules
:
{
title02
:
[
{
required
:
true
,
message
:
"名称不能为空"
,
trigger
:
"blur"
},
],
title02
:
[{
required
:
true
,
message
:
"名称不能为空"
,
trigger
:
"blur"
}],
organizationType
:
[
{
// type: 'array',
...
...
@@ -137,7 +133,6 @@ export default {
};
Api
.
create
(
paramsdata
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -146,7 +141,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
}
...
...
pages/basicData/department/edit.vue
View file @
1980d95c
...
...
@@ -34,7 +34,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<!-- 组织类型 -->
...
...
@@ -57,7 +57,6 @@ export default {
city_level
:
[],
propertyList
:
[],
showTree
:
false
,
//组织类型
disabled
:
false
,
citys
:
citys
(),
entity
:
{
organization_Id
:
0
,
//组织类型
...
...
@@ -69,7 +68,7 @@ export default {
isProduction
:
1
,
code
:
""
,
property
:
""
,
id
:
-
1
id
:
-
1
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
...
...
@@ -78,19 +77,19 @@ export default {
{
required
:
true
,
message
:
"属性不能为空"
,
trigger
:
"change"
}
]
}
trigger
:
"change"
,
}
,
]
,
}
,
};
},
props
:
{
row
:
Object
row
:
Object
,
},
created
()
{},
methods
:
{
handleSubmit
()
{
this
.
$refs
[
"form"
].
validate
(
value
=>
{
this
.
$refs
[
"form"
].
validate
(
(
value
)
=>
{
if
(
value
)
{
if
(
this
.
entity
.
id
>
0
)
{
let
isProduction
=
0
;
...
...
@@ -132,11 +131,10 @@ export default {
organization_Id
:
this
.
entity
.
organization_Id
,
//组织类型 [id]
location
:
location
,
//省市县
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
//属性
property
:
property
,
//属性
};
Api
.
update
(
paramsdata
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"编辑成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -144,8 +142,7 @@ export default {
this
.
$Message
.
error
(
"编辑失败,请联系管理员"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"编辑失败,请联系管理员"
);
});
}
...
...
@@ -158,7 +155,7 @@ export default {
l
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
,
},
watch
:
{
"row.id"
(
v
)
{
...
...
@@ -173,7 +170,7 @@ export default {
property
:
this
.
row
.
property
,
id
:
this
.
row
.
id
,
organization_Id
:
this
.
row
.
organization_Id
,
organizationType
:
this
.
row
.
organizationType
organizationType
:
this
.
row
.
organizationType
,
};
if
(
!
model
.
property
)
{
model
.
property
=
""
;
...
...
@@ -187,7 +184,7 @@ export default {
this
.
city_level
=
model
.
location
.
split
(
","
);
}
this
.
entity
=
model
;
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/basicData/dic/components/add.vue
0 → 100644
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"类别"
prop=
"typeId"
>
<RadioGroup
v-model=
"entity.typeId"
>
<Radio
:label=
"0"
disabled
>
系统
</Radio>
<Radio
:label=
"1"
disabled
>
分类
</Radio>
<Radio
:label=
"2"
disabled
>
字典
</Radio>
<Radio
:label=
"3"
disabled
>
字典项
</Radio>
</RadioGroup>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
transfer
recommend
/>
</Input>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
/>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"图标"
prop=
"icon"
>
<InputIcon
v-model=
"entity.icon"
></InputIcon>
</FormItem>
</Row>
<FormItem
label=
"状态"
prop=
"number"
>
<RadioGroup
v-model=
"entity.status"
>
<Radio
:label=
"0"
>
启用
</Radio>
<Radio
:label=
"1"
>
禁用(名称和值可以启用或禁用,但不能删除)
</Radio>
</RadioGroup>
</FormItem>
<FormItem
label=
"锁定"
prop=
"number"
>
<RadioGroup
v-model=
"entity.isStatic"
>
<Radio
:label=
"0"
>
不锁定
</Radio>
<Radio
:label=
"1"
>
锁定(锁定后不可改变名称和值,不能删除)
</Radio>
</RadioGroup>
</FormItem>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
api
from
"../api.js"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{
upId
:
0
,
typeId
:
this
.
v
.
typeId
,
status
:
0
,
isStatic
:
0
,
priority
:
0
,
color
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
[
"v"
],
mounted
()
{
if
(
this
.
v
.
id
)
{
this
.
entity
.
typeId
=
this
.
v
.
typeId
+
1
;
this
.
entity
.
upId
=
this
.
v
.
id
;
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
api
.
save
(
this
.
entity
).
then
((
r
)
=>
{
console
.
warn
(
r
);
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"添加成功"
);
this
.
$emit
(
"on-ok"
);
}
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
},
watch
:
{},
};
</
script
>
pages/basicData/dic/components/edit.vue
View file @
1980d95c
...
...
@@ -45,7 +45,7 @@
</FormItem>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -55,7 +55,9 @@ export default {
name
:
'Edit'
,
data
()
{
return
{
entity
:
this
.
v
,
entity
:
{
color
:
""
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
...
...
@@ -65,6 +67,13 @@ export default {
props
:
{
v
:
Object
},
mounted
(){
this
.
entity
=
this
.
v
if
(
!
this
.
entity
.
color
){
this
.
entity
.
color
=
""
;
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
...
...
@@ -86,6 +95,9 @@ export default {
watch
:
{
v
(
v
)
{
this
.
entity
=
this
.
v
if
(
!
this
.
entity
.
color
){
this
.
entity
.
color
=
""
;
}
console
.
info
(
this
.
entity
)
}
}
...
...
pages/basicData/dic/index.vue
View file @
1980d95c
<
template
>
<Layout
class=
"full"
>
<Sider
hide-trigger
:style=
"
{background: '#fff'}" class="menu" width="240">
<Sider
hide-trigger
:style=
"
{ background: '#fff' }"
class="menu"
width="240"
>
<h3
class=
"title"
>
数据字典
<ButtonGroup
class=
"fr"
size=
"small"
>
<Button
icon=
"md-add"
title=
"新增顶级"
@
click=
"add(0)"
></Button>
<Button>
<Icon
:type=
"expand
?'md-arrow-dropright':
'md-arrow-dropdown'"
:type=
"expand
? 'md-arrow-dropright' :
'md-arrow-dropdown'"
size=
"16"
@
click=
"toggle"
title=
"展开/合并"
...
...
@@ -18,22 +24,48 @@
</ButtonGroup>
</h3>
<div>
<Input
v-model
.
trim=
"keys"
search
placeholder=
"请输入客户名称"
clearable
/>
<Input
v-model
.
trim=
"keys"
search
placeholder=
"请输入名称/编码"
clearable
/>
<Tree
:data=
"projectList"
@
on-select-change=
"change"
class=
"tree-i"
:render=
"renderContent"
/>
<Dropdown
transfer
ref=
"contentMenu"
style=
"display: none"
trigger=
"click"
placement=
"right-start"
>
<DropdownMenu
slot=
"list"
ref=
"ppp"
style=
"min-width: 80px"
>
<DropdownItem
@
click
.
native=
"add"
>
<a>
添加
</a>
</DropdownItem>
<DropdownItem
name=
"edit"
@
click
.
native=
"editRight"
>
<a>
修改
</a>
</DropdownItem>
<!--
<DropdownItem
name=
"del"
@
click
.
native=
"removeNew"
>
<a>
删除
</a>
</DropdownItem>
-->
</DropdownMenu>
</Dropdown>
</div>
</Sider>
<Content
class=
"content"
>
<Tools>
<Breadcrumb
style=
"display:inline-block"
>
<BreadcrumbItem
v-for=
"(li,i) in names"
:key=
"i"
>
{{
li
}}
</BreadcrumbItem>
<Breadcrumb
style=
"display: inline-block"
>
<BreadcrumbItem
v-for=
"(li, i) in names"
:key=
"i"
>
{{
li
}}
</BreadcrumbItem>
</Breadcrumb>
<template
slot=
"btns"
>
<span
class=
"mr20"
v-if=
"node.typeId
==
2"
>
<span
class=
"mr20"
v-if=
"node.typeId
==
2"
>
索引:
<a
data-clipboard-action=
"copy"
...
...
@@ -41,7 +73,8 @@
@
click=
"copy"
id=
"code"
class=
"tag-read"
>
{{
node
.
code
}}
</a>
>
{{
node
.
code
}}
</a
>
</span>
<Button
type=
"default"
@
click=
"setRoot"
>
返回顶级
</Button>
</
template
>
...
...
@@ -53,12 +86,16 @@
border
:columns=
"columns"
:data=
"data"
:draggable=
"edit
==
-1"
:draggable=
"edit
==
-1"
class=
"tableCommon"
@
on-drag-drop=
"onDragDrop"
>
<
template
slot-scope=
"{ row, index }"
slot=
"typeId"
>
<state
code=
"system.dictionary.typeId"
type=
"text"
:value=
"row.typeId"
></state>
<state
code=
"system.dictionary.typeId"
type=
"text"
:value=
"row.typeId"
></state>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"status"
>
<state
code=
"status"
type=
"tag"
:value=
"row.status"
></state>
...
...
@@ -67,16 +104,16 @@
<state
code=
"isStatic"
type=
"tag"
:value=
"row.isStatic"
></state>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"name"
>
<span
v-if=
"edit
!=
index"
v-text=
"row.name"
></span>
<span
v-if=
"edit
!=
index"
v-text=
"row.name"
></span>
<Input
v-else
type=
"text"
v-model
.
trim=
"cur.name"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"color"
>
<div
v-if=
"edit
!=
index"
>
<div
v-if=
"edit
!=
index"
>
<ColorPicker
:value=
"row.color
||
''"
:value=
"row.color
||
''"
transfer
recommend
@
on-change=
"setColor($event,
row,
index)"
@
on-change=
"setColor($event,
row,
index)"
/>
</div>
<div
v-else
>
...
...
@@ -85,17 +122,20 @@
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"icon"
>
<div
v-if=
"row.icon"
>
<Icon
:type=
"row.icon"
@
on-change=
"setColor($event,row,index)"
/>
<Icon
:type=
"row.icon"
@
on-change=
"setColor($event, row, index)"
/>
</div>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<span
v-if=
"edit
!=
index"
v-text=
"row.code"
></span>
<span
v-if=
"edit
!=
index"
v-text=
"row.code"
></span>
<Input
v-else
type=
"text"
v-model
.
trim=
"cur.code"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<div
v-if=
"edit
!=
index"
class=
"action"
>
<op
class=
"edit"
@
click=
"editRow(row,index)"
>
编辑
</op>
<!--
<op
class=
"remove"
@
click=
"delRow(row,index)"
>
删除
</op>
-->
<div
v-if=
"edit
!=
index"
class=
"action"
>
<op
class=
"edit"
@
click=
"editRow(row,
index)"
>
编辑
</op>
<!--
<op
class=
"remove"
@
click=
"delRow(row,
index)"
>
删除
</op>
-->
</div>
<div
class=
"action"
v-else
>
<op
class=
"edit"
@
click=
"save"
>
保存
</op>
...
...
@@ -103,36 +143,53 @@
</div>
</
template
>
</Table>
<Button
type=
"primary"
:disabled=
"edit!=-1"
long
@
click=
"addNew"
class=
"mt10"
>
添加
</Button>
<Alert
type=
"info"
class=
"mt10"
v-if=
"data.length>1&&edit==-1"
>
提示: 支持拖拽排序,数据未保存时不可拖拽排序。
</Alert>
<Button
type=
"primary"
:disabled=
"edit != -1"
long
@
click=
"addNew"
class=
"mt10"
>
添加
</Button
>
<Alert
type=
"info"
class=
"mt10"
v-if=
"data.length > 1 && edit == -1"
>
提示: 支持拖拽排序,数据未保存时不可拖拽排序。
</Alert
>
</div>
<Modal
v-model=
"editModal"
:title=
"editTitle"
footer-hide
>
<Edit
:v=
"editModel"
@
on-close=
"editModal=false"
@
on-ok=
"editOk"
/>
<component
:is=
"datail"
:v=
"editModel"
@
on-close=
"editModal = false"
@
on-ok=
"editOk"
/>
</Modal>
</Content>
</Layout>
</template>
<
script
>
import
Edit
from
"./components/edit"
;
import
api
from
"./api.js"
;
import
Clipboard
from
"clipboard"
;
const
root
=
{
id
:
0
,
typeId
:
-
1
,
title
:
"顶级节点"
,
code
:
""
code
:
""
,
};
export
default
{
data
()
{
return
{
datail
:
null
,
addTitle
:
"新增"
,
addModal
:
false
,
keys
:
""
,
treeHeight
:
""
,
code
:
"2"
,
expand
:
false
,
editModal
:
false
,
editModel
:
{
color
:
""
color
:
""
,
},
editTitle
:
"编辑"
,
node
:
root
,
color4
:
""
,
...
...
@@ -147,64 +204,64 @@ export default {
{
type
:
"index"
,
width
:
60
,
align
:
"center"
align
:
"center"
,
},
{
title
:
"类别"
,
key
:
"typeId"
,
width
:
100
,
align
:
"center"
,
slot
:
"typeId"
slot
:
"typeId"
,
},
{
title
:
"颜色"
,
key
:
"color"
,
width
:
100
,
align
:
"center"
,
slot
:
"color"
slot
:
"color"
,
},
{
title
:
"名称"
,
key
:
"name"
,
width
:
150
,
slot
:
"name"
slot
:
"name"
,
},
{
title
:
"编码"
,
key
:
"code"
,
slot
:
"code"
slot
:
"code"
,
},
{
title
:
"图标"
,
key
:
"icon"
,
slot
:
"icon"
slot
:
"icon"
,
},
{
title
:
"描述"
,
key
:
"description"
key
:
"description"
,
},
{
title
:
"状态"
,
key
:
"status"
,
width
:
100
,
align
:
"center"
,
slot
:
"status"
slot
:
"status"
,
},
{
title
:
"锁定"
,
key
:
"isStatic"
,
width
:
100
,
align
:
"center"
,
slot
:
"isStatic"
slot
:
"isStatic"
,
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
160
,
align
:
"center"
,
slot
:
"action"
}
]
slot
:
"action"
,
}
,
]
,
};
},
computed
:
{
...
...
@@ -214,7 +271,7 @@ export default {
let
items
=
this
.
tree
;
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
(
u
=>
{
data
.
map
(
(
u
)
=>
{
if
(
keys
.
length
==
u
.
title
)
{
result
.
push
(
u
);
}
else
{
...
...
@@ -235,9 +292,8 @@ export default {
});
}
return
result
;
}
}
,
},
components
:
{
Edit
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
...
...
@@ -259,56 +315,121 @@ export default {
},
methods
:
{
renderContent
(
h
,
{
root
,
node
,
data
})
{
// console.log(data);
return
h
(
"span"
,
[
h
(
"Poptip"
,
{
props
:
{
content
:
data
.
data
.
code
,
trigger
:
"hover"
,
placement
:
"top-start"
},
style
:
{
cursor
:
"pointer"
}
},[
h
(
'span'
,{
h
(
"Poptip"
,
{
props
:
{
content
:
data
.
data
.
code
,
trigger
:
"hover"
,
placement
:
"top-start"
,
},
style
:
{
cursor
:
"pointer"
,
color
:
data
.
data
.
status
==
1
?
"#ccc"
:
"#515a6e"
,
},
},
data
.
title
)
])
],
[
h
(
"State"
,
{
props
:
{
value
:
data
.
data
.
typeId
,
code
:
"system.dictionary.typeId"
,
type
:
"tag"
,
},
},
data
.
data
.
typeId
),
h
(
"span"
,
{
on
:
{
// click: () => {
// this.handleSelect(data); //手动选择树节点
// },
//右键点击事件
contextmenu
:
(
e
)
=>
{
e
.
preventDefault
();
this
.
$refs
.
contentMenu
.
$refs
.
reference
=
event
.
target
;
this
.
$refs
.
contentMenu
.
currentVisible
=
!
this
.
$refs
.
contentMenu
.
currentVisible
;
this
.
editModel
=
data
.
data
;
console
.
warn
(
"addd"
,
this
.
editModel
);
},
},
},
data
.
title
// +" ["+data.data.typeId+"]"
),
]
),
]
// data.title
);
},
copy
()
{
var
clipboard
=
new
Clipboard
(
".tag-read"
);
clipboard
.
on
(
"success"
,
e
=>
{
clipboard
.
on
(
"success"
,
(
e
)
=>
{
this
.
$Message
.
success
(
"复制成功:"
+
this
.
node
.
code
);
clipboard
.
destroy
();
});
clipboard
.
on
(
"error"
,
e
=>
{
clipboard
.
on
(
"error"
,
(
e
)
=>
{
// 不支持复制
console
.
log
(
"该浏览器不支持自动复制"
);
// 释放内存
clipboard
.
destroy
();
});
},
editRight
()
{
this
.
editRow
(
this
.
editModel
);
},
editRow
(
row
,
index
)
{
this
.
editTitle
=
"编辑"
;
this
.
editModal
=
true
;
this
.
editModel
=
row
;
this
.
datail
=
()
=>
import
(
"./components/edit"
);
},
toggle
()
{
this
.
expand
=
!
this
.
expand
;
this
.
loadTree
();
},
addOk
()
{
this
.
load
();
this
.
loadTree
();
this
.
addModal
=
false
;
this
.
detail
=
null
;
},
add
(
upId
)
{
if
(
upId
==
0
)
{
this
.
editModel
=
{
// id:-1,
upId
:
0
,
name
:
""
,
code
:
""
,
color
:
""
,
status
:
0
,
isStatic
:
0
,
typeId
:
0
,
priority
:
this
.
edit
,
};
// console.warn("VVVVVVVVVVVVVVVVV")
}
this
.
datail
=
()
=>
import
(
"./components/add"
);
this
.
editModal
=
true
;
},
editOk
()
{
this
.
load
();
this
.
editModal
=
false
;
},
removeNew
()
{
this
.
delRow
(
this
.
editModel
);
},
delRow
(
row
,
index
)
{
var
url
=
`
${
systemUrl
}
/Dictionary/Delete?id=
${
row
.
id
}
`
;
this
.
$Modal
.
confirm
({
...
...
@@ -317,16 +438,16 @@ export default {
onOk
:
()
=>
{
this
.
$api
.
delete
(
`
${
url
}
`
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"删除成功"
);
this
.
load
();
}
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
$Message
.
error
(
"删除失败"
);
});
}
}
,
});
},
change
(
nodes
,
node
)
{
...
...
@@ -335,7 +456,7 @@ export default {
id
:
node
.
id
,
typeId
:
node
.
data
.
typeId
,
title
:
node
.
title
,
code
:
node
.
data
.
code
code
:
node
.
data
.
code
,
};
// this.names = [node.title]
let
cur
=
node
;
...
...
@@ -374,7 +495,7 @@ export default {
var
expand
=
this
.
expand
;
setParent
(
null
,
items
);
function
setParent
(
parent
,
items
)
{
items
.
map
(
u
=>
{
items
.
map
(
(
u
)
=>
{
u
.
parent
=
parent
;
u
.
expand
=
expand
;
if
(
u
.
children
)
{
...
...
@@ -388,11 +509,11 @@ export default {
onDragDrop
(
a
,
b
)
{
this
.
data
.
splice
(
b
,
1
,
...
this
.
data
.
splice
(
a
,
1
,
this
.
data
[
b
]));
let
ids
=
[];
this
.
data
.
map
(
u
=>
{
this
.
data
.
map
(
(
u
)
=>
{
ids
.
push
(
u
.
id
);
});
if
(
ids
.
length
>
1
)
{
api
.
setSort
({
ids
}).
then
(
r
=>
{
api
.
setSort
({
ids
}).
then
(
(
r
)
=>
{
if
(
!
r
.
success
)
{
this
.
$Message
.
error
(
"排序失败"
);
this
.
load
();
...
...
@@ -400,6 +521,7 @@ export default {
});
}
},
addNew
()
{
this
.
edit
=
this
.
data
.
length
;
this
.
cur
=
{
...
...
@@ -410,7 +532,7 @@ export default {
status
:
0
,
isStatic
:
0
,
typeId
:
this
.
node
.
typeId
+
1
,
priority
:
this
.
edit
priority
:
this
.
edit
,
};
this
.
data
.
push
(
this
.
cur
);
},
...
...
@@ -428,15 +550,15 @@ export default {
this
.
$Message
.
error
(
"值不能为空"
);
return
;
}
api
.
save
(
this
.
cur
).
then
(
r
=>
{
console
.
warn
(
r
);
api
.
save
(
this
.
cur
).
then
(
(
r
)
=>
{
//
console.warn(r);
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"添加成功"
);
this
.
load
();
}
});
}
}
}
,
}
,
};
</
script
>
<
style
lang=
"less"
scoped
>
...
...
pages/basicData/menu/add.vue
View file @
1980d95c
...
...
@@ -14,7 +14,12 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"mes_xingchi_system.menu.type"
:disabled=
"true"
v-model=
"entity.type"
type=
"radio"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.type"
:disabled=
"true"
v-model=
"entity.type"
type=
"radio"
></Dictionary>
<!-- -->
</FormItem>
</Col>
...
...
@@ -32,28 +37,41 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('target')"
prop=
"target"
>
<Dictionary
code=
"mes_xingchi_system.menu.target"
v-model=
"entity.target"
type=
"radio"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.target"
v-model=
"entity.target"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"mes_xingchi_system.menu.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('source')"
prop=
"source"
>
<Dictionary
code=
"mes_xingchi_system.menu.source"
type=
"radio"
disabled
v-model=
"entity.source"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.source"
type=
"radio"
disabled
v-model=
"entity.source"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"6"
>
<Col
:span=
"6"
>
<FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
></Input>
</FormItem>
</Col>
<Col
:span=
"6"
>
<FormItem
:label=
"l('app')"
prop=
"app"
>
<Input
v-model=
"entity.app"
:disabled=
"entity.upId
!=
0"
></Input>
<Input
v-model=
"entity.app"
:disabled=
"entity.upId
!=
0"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
...
...
@@ -68,82 +86,78 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Add'
,
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
id
:
0
,
name
:
''
,
name
:
""
,
upId
:
0
,
type
:
1
,
code
:
''
,
icon
:
''
,
code
:
""
,
icon
:
""
,
target
:
0
,
url
:
''
,
url
:
""
,
status
:
1
,
description
:
''
,
description
:
""
,
source
:
0
,
app
:
''
,
priority
:
0
app
:
""
,
priority
:
0
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
}
,
}
;
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
disabled
=
false
this
.
$refs
.
form
.
resetFields
()
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
this
.
$refs
.
form
.
resetFields
()
;
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
disabled
=
false
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'menu'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"menu"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
v
(
val
)
{
// console.log(JSON.stringify(this.$u.clone(this.v)));
console
.
log
(
this
.
v
)
this
.
entity
.
upId
=
this
.
v
.
id
this
.
entity
.
type
=
this
.
v
.
type
+
1
this
.
entity
.
app
=
this
.
v
.
app
}
}
}
console
.
log
(
this
.
v
)
;
this
.
entity
.
upId
=
this
.
v
.
id
;
this
.
entity
.
type
=
this
.
v
.
type
+
1
;
this
.
entity
.
app
=
this
.
v
.
app
;
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/menu/addApi.vue
View file @
1980d95c
...
...
@@ -2,7 +2,7 @@
<div>
<DataGrid
:columns=
"columns"
:action=
"index"
border
:height=
"400"
:conditions=
"conditions"
@
on-selection-change=
"selectionChange"
:set=
"false"
:high=
"false"
></DataGrid>
<div>
<Button
v-if=
"items.length>0"
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
v-if=
"items.length>0"
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</div>
</div>
...
...
@@ -14,7 +14,7 @@ export default {
data
()
{
return
{
index
:
Api
.
method
,
disabled
:
false
,
list
:
[],
controller
:
null
,
keys
:
""
,
...
...
pages/basicData/menu/edit.vue
View file @
1980d95c
...
...
@@ -30,12 +30,20 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('target')"
prop=
"target"
>
<Dictionary
code=
"mes_xingchi_system.menu.target"
v-model=
"entity.target"
type=
"radio"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.target"
v-model=
"entity.target"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"mes_xingchi_system.menu.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
<Dictionary
code=
"mes_xingchi_system.menu.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
...
...
@@ -56,7 +64,7 @@
</Col>
<Col
:span=
"6"
>
<FormItem
:label=
"l('app')"
prop=
"app"
>
<Input
v-model=
"entity.app"
:disabled=
"entity.upId
!=
0"
></Input>
<Input
v-model=
"entity.app"
:disabled=
"entity.upId
!=
0"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
...
...
@@ -71,75 +79,71 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
export
default
{
name
:
'Edit'
,
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
color
:
''
color
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
}
,
}
;
},
props
:
{
eid
:
Number
,
v
:
Object
},
v
:
Object
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
this
.
$emit
(
'on-load'
)
})
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
})
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
disabled
=
false
this
.
$refs
.
form
.
resetFields
()
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
this
.
$refs
.
form
.
resetFields
()
;
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
disabled
=
false
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
})
})
;
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
'menu'
+
'.'
+
key
return
this
.
$t
(
key
)
}
key
=
"menu"
+
"."
+
key
;
return
this
.
$t
(
key
)
;
}
,
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
)
this
.
load
(
v
)
;
}
}
}
}
}
,
}
,
}
;
</
script
>
\ No newline at end of file
pages/basicData/messageConfig/add.vue
View file @
1980d95c
...
...
@@ -32,7 +32,11 @@
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"message.config.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
<Dictionary
code=
"message.config.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
...
...
@@ -53,7 +57,13 @@
<Col
:span=
"6"
>
<FormItem
:label=
"l('color')"
prop=
"color"
>
<Input
v-model=
"entity.color"
>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
recommend
/>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
recommend
/>
</Input>
</FormItem>
</Col>
...
...
@@ -69,7 +79,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -92,7 +102,6 @@ export default {
});
};
return
{
disabled
:
false
,
entity
:
{
// creationTime: "",
// creatorUserId: null,
...
...
@@ -143,10 +152,8 @@ export default {
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -155,7 +162,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
pages/basicData/messageConfig/edit.vue
View file @
1980d95c
...
...
@@ -32,7 +32,11 @@
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"message.config.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
<Dictionary
code=
"message.config.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
...
...
@@ -53,7 +57,13 @@
<Col
:span=
"6"
>
<FormItem
:label=
"l('color')"
prop=
"color"
>
<Input
v-model=
"entity.color"
>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
recommend
/>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
recommend
/>
</Input>
</FormItem>
</Col>
...
...
@@ -69,7 +79,7 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -80,9 +90,8 @@ export default {
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
color
:
""
color
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
...
...
@@ -106,7 +115,7 @@ export default {
r
.
result
.
userIds
=
this
.
$u
.
toIntArray
(
r
.
result
.
userIds
);
r
.
result
.
roleIds
=
this
.
$u
.
toIntArray
(
r
.
result
.
roleIds
);
r
.
result
.
departmentIds
=
this
.
$u
.
toIntArray
(
r
.
result
.
departmentIds
);
if
(
r
.
result
.
color
==
null
)
{
if
(
r
.
result
.
color
==
null
)
{
r
.
result
.
color
=
""
;
}
this
.
entity
=
r
.
result
;
...
...
@@ -125,10 +134,8 @@ export default {
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -137,7 +144,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
pages/basicData/method/add.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem></Col>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('httpMethod')"
prop=
"httpMethod"
>
<Input
v-model=
"entity.httpMethod"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('url')"
prop=
"url"
>
<Input
v-model=
"entity.url"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('methodDescription')"
>
<Input
v-model=
"entity.methodDescription"
prop=
"methodDescription"
type=
"textarea"
:rows=
"5"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('service')"
prop=
"service"
>
<Input
v-model=
"entity.service"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('serviceDescription')"
prop=
"serviceDescription"
>
<Input
v-model=
"entity.serviceDescription"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controller')"
prop=
"controller"
>
<Input
v-model=
"entity.controller"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controllerDescription')"
prop=
"controllerDescription"
>
<Input
v-model=
"entity.controllerDescription"
></Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('httpMethod')"
prop=
"httpMethod"
>
<Input
v-model=
"entity.httpMethod"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('url')"
prop=
"url"
>
<Input
v-model=
"entity.url"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('methodDescription')"
>
<Input
v-model=
"entity.methodDescription"
prop=
"methodDescription"
type=
"textarea"
:rows=
"5"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('service')"
prop=
"service"
>
<Input
v-model=
"entity.service"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('serviceDescription')"
prop=
"serviceDescription"
>
<Input
v-model=
"entity.serviceDescription"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controller')"
prop=
"controller"
>
<Input
v-model=
"entity.controller"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controllerDescription')"
prop=
"controllerDescription"
>
<Input
v-model=
"entity.controllerDescription"
></Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Dictionary
v-model=
"entity.level"
code=
"system.method.level"
type=
"radio"
></Dictionary>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Dictionary
v-model=
"entity.level"
code=
"system.method.level"
type=
"radio"
></Dictionary>
</FormItem></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem></Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Add'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
title
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
url
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
v
:
Object
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"method"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
rules
:
{
title
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
url
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
</
script
>
\ No newline at end of file
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"method"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
},
};
</
script
>
\ No newline at end of file
pages/basicData/method/edit.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem></Col>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('httpMethod')"
prop=
"httpMethod"
>
<Input
v-model=
"entity.httpMethod"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('url')"
prop=
"url"
>
<Input
v-model=
"entity.url"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('methodDescription')"
>
<Input
v-model=
"entity.methodDescription"
prop=
"methodDescription"
type=
"textarea"
:rows=
"5"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('service')"
prop=
"service"
>
<Input
v-model=
"entity.service"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('serviceDescription')"
prop=
"serviceDescription"
>
<Input
v-model=
"entity.serviceDescription"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controller')"
prop=
"controller"
>
<Input
v-model=
"entity.controller"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controllerDescription')"
prop=
"controllerDescription"
>
<Input
v-model=
"entity.controllerDescription"
></Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('httpMethod')"
prop=
"httpMethod"
>
<Input
v-model=
"entity.httpMethod"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('url')"
prop=
"url"
>
<Input
v-model=
"entity.url"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('methodDescription')"
>
<Input
v-model=
"entity.methodDescription"
prop=
"methodDescription"
type=
"textarea"
:rows=
"5"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('service')"
prop=
"service"
>
<Input
v-model=
"entity.service"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('serviceDescription')"
prop=
"serviceDescription"
>
<Input
v-model=
"entity.serviceDescription"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controller')"
prop=
"controller"
>
<Input
v-model=
"entity.controller"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('controllerDescription')"
prop=
"controllerDescription"
>
<Input
v-model=
"entity.controllerDescription"
></Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Dictionary
v-model=
"entity.level"
code=
"system.method.level"
type=
"radio"
></Dictionary>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Dictionary
v-model=
"entity.level"
code=
"system.method.level"
type=
"radio"
></Dictionary>
</FormItem></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem></Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Edit'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
title
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
url
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
eid
:
Number
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
'on-load'
)
})
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"method"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{},
rules
:
{
title
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
url
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"method"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/basicData/systemUser/add.vue
View file @
1980d95c
<
template
>
<div
class=
"addUser"
>
<div
class=
"addUser"
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<Input
v-model=
"entity.cardNo"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<Input
v-model=
"entity.cardNo"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('enableEquip')"
prop=
"enableEquip"
>
<Input
v-model=
"entity.enableEquip"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</div>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
import
util
from
'@/libs/util'
;
import
util
from
"@/libs/util"
;
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
};
export
default
{
name
:
"Add"
,
components
:
{},
data
()
{
const
validateCarNo
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"员工编号不能为空"
));
}
Api
.
list
(
value
).
then
(
r
=>
{
if
(
r
.
result
.
length
>
0
)
{
return
callback
(
new
Error
(
"员工编号已经存在"
));
}
else
{
callback
();
}
});
};
return
{
disabled
:
false
,
showDeptTree
:
false
,
entity
:
{
gender
:
1
,
status
:
1
,
property
:
false
,
userType
:
2
},
rules
:
{
userName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
cardNo
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCarNo
,
trigger
:
"blur"
}
],
departmentTitle
:
[{
required
:
true
,
message
:
"必选"
,
trigger
:
"change"
}],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}]
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// phone: [{ required: true, message: '必填', trigger: 'blur' }]
}
};
},
props
:
{
v
:
Object
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
if
(
this
.
entity
.
property
)
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
let
parms
=
{
userId
:
r
.
result
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
//状态
// tenantCode: this.$store.state.userInfo.tenantCode, //商户号
tenantCode
:
util
.
cookies
.
get
(
'tenantCode'
),
//商户号
name
:
this
.
entity
.
userName
};
Api
.
authAccount
(
parms
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res
.
result
};
Api
.
updateAccount
(
parms1
).
then
(
res1
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"同步失败"
);
}
});
//修改用户表的accountId end
}
});
name
:
"Add"
,
components
:
{},
data
()
{
const
validateCarNo
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"员工编号不能为空"
));
}
Api
.
list
(
value
).
then
((
r
)
=>
{
if
(
r
.
result
.
length
>
0
)
{
return
callback
(
new
Error
(
"员工编号已经存在"
));
}
else
{
callback
();
}
});
};
return
{
showDeptTree
:
false
,
entity
:
{
gender
:
1
,
status
:
1
,
property
:
false
,
userType
:
2
,
},
rules
:
{
userName
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
],
cardNo
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
{
validator
:
validateCarNo
,
trigger
:
"blur"
,
},
],
departmentTitle
:
[
{
required
:
true
,
message
:
"必选"
,
trigger
:
"change"
,
},
],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[
{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
,
},
],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// phone: [{ required: true, message: '必填', trigger: 'blur' }]
},
};
},
props
:
{
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
if
(
this
.
entity
.
property
)
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
//账户同步操作end
}
else
{
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
// alert(JSON.stringify(err))
console
.
warn
(
err
);
this
.
disabled
=
false
;
this
.
$Message
.
error
(
err
.
error
.
message
);
});
}
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
let
parms
=
{
userId
:
r
.
result
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
//状态
// tenantCode: this.$store.state.userInfo.tenantCode, //商户号
tenantCode
:
util
.
cookies
.
get
(
"tenantCode"
),
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res
.
result
,
};
Api
.
updateAccount
(
parms1
).
then
((
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"同步失败"
);
}
});
//修改用户表的accountId end
}
});
//账户同步操作end
}
else
{
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
((
err
)
=>
{
// alert(JSON.stringify(err))
console
.
warn
(
err
);
this
.
$Message
.
error
(
err
.
error
.
message
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
},
selectDepart
()
{
this
.
showDeptTree
=
true
;
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
}
});
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
}
}
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
},
selectDepart
()
{
this
.
showDeptTree
=
true
;
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
},
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
},
};
</
script
>
<
style
lang=
"less"
>
.addUser {
.ivu-radio-wrapper {
vertical-align: top;
}
.ivu-radio-wrapper {
vertical-align: top;
}
}
</
style
>
pages/basicData/systemUser/edit.vue
View file @
1980d95c
<
template
>
<div
class=
"addUser"
>
<div
class=
"addUser"
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<span
v-text=
"entity.cardNo"
></span>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
style=
"width:100%"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<span
v-text=
"entity.cardNo"
></span>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
style=
"width: 100%"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('enableEquip')"
prop=
"enableEquip"
>
<Input
v-model=
"entity.enableEquip"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"用户类型"
>
<Dictionary
code=
"User.base.UserType"
v-model=
"entity.userType"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"用户类型"
>
<Dictionary
code=
"User.base.UserType"
v-model=
"entity.userType"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</div>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
};
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
showDeptTree
:
false
,
entity
:
{},
rules
:
{
userName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
departmentTitle
:
[{
required
:
true
,
message
:
"必选"
,
trigger
:
"blur"
}],
//cardNo: [{ required: true, message: '必填', trigger: 'blur' }],
// birthday: [{ required: true, message: '必填', trigger: 'change' }],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}]
}
};
},
props
:
{
eid
:
Number
name
:
"Edit"
,
data
()
{
return
{
showDeptTree
:
false
,
entity
:
{},
rules
:
{
userName
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
],
departmentTitle
:
[
{
required
:
true
,
message
:
"必选"
,
trigger
:
"blur"
,
},
],
//cardNo: [{ required: true, message: '必填', trigger: 'blur' }],
// birthday: [{ required: true, message: '必填', trigger: 'change' }],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[
{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
,
},
],
},
};
},
props
:
{
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
,
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
if
(
r
.
result
.
property
==
2
)
{
this
.
entity
.
property
=
true
;
}
else
{
this
.
entity
.
property
=
false
;
}
this
.
$emit
(
"on-load"
);
});
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
if
(
r
.
result
.
property
==
2
)
{
this
.
entity
.
property
=
true
;
}
else
{
this
.
entity
.
property
=
false
;
}
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
if
((
this
.
entity
.
property
=
true
))
{
this
.
entity
.
property
=
2
;
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
if
((
this
.
entity
.
property
=
true
))
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
if
(
this
.
entity
.
accountId
>
0
)
{
//账户已同步的情况下
let
parms2
=
{
accountId
:
this
.
entity
.
accountId
,
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms2
).
then
((
res
)
=>
{
//同步电话信息等
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
}
else
{
this
.
entity
.
property
=
""
;
this
.
$Message
.
error
(
"账户同步失败"
);
}
});
}
else
{
//账户新建后还未同步成功的情况下
let
parms
=
{
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms
).
then
((
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res1
.
result
,
//账户同步成功后返回的accountId
};
Api
.
updateAccount
(
parms1
).
then
((
res2
)
=>
{
if
(
res2
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
}
else
{
this
.
$Message
.
error
(
"操作失败"
);
}
});
//修改用户表的accountId end
}
Api
.
update
(
this
.
entity
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
if
(
this
.
entity
.
accountId
>
0
)
{
//账户已同步的情况下
let
parms2
=
{
accountId
:
this
.
entity
.
accountId
,
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
};
Api
.
authAccount
(
parms2
).
then
(
res
=>
{
//同步电话信息等
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
}
else
{
this
.
$Message
.
error
(
"账户同步失败"
);
}
});
}
else
{
//账户新建后还未同步成功的情况下
let
parms
=
{
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
};
Api
.
authAccount
(
parms
).
then
(
res1
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res1
.
result
//账户同步成功后返回的accountId
};
Api
.
updateAccount
(
parms1
).
then
(
res2
=>
{
if
(
res2
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
}
else
{
this
.
$Message
.
error
(
"操作失败"
);
}
});
//修改用户表的accountId end
}
});
}
//账户同步操作end
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
});
}
//账户同步操作end
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
if
(
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
}
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
}
});
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
}
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
if
(
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
}
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
<
style
lang=
"less"
>
.addUser {
.ivu-radio-wrapper {
vertical-align: top;
}
.ivu-radio-wrapper {
vertical-align: top;
}
}
</
style
>
pages/basicData/user/add.vue
View file @
1980d95c
...
...
@@ -80,17 +80,16 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
import
util
from
'@/libs/util'
;
import
util
from
"@/libs/util"
;
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
...
...
@@ -109,7 +108,7 @@ export default {
if
(
!
value
)
{
return
callback
(
new
Error
(
"员工编号不能为空"
));
}
Api
.
list
(
value
).
then
(
r
=>
{
Api
.
list
(
value
).
then
(
(
r
)
=>
{
if
(
r
.
result
.
length
>
0
)
{
return
callback
(
new
Error
(
"员工编号已经存在"
));
}
else
{
...
...
@@ -118,66 +117,64 @@ export default {
});
};
return
{
disabled
:
false
,
showDeptTree
:
false
,
entity
:
{
gender
:
1
,
status
:
1
,
property
:
false
,
userType
:
0
userType
:
0
,
},
rules
:
{
userName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
trigger
:
"blur"
,
}
,
],
cardNo
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
trigger
:
"blur"
,
},
{
validator
:
validateCarNo
,
trigger
:
"blur"
}
trigger
:
"blur"
,
}
,
],
departmentTitle
:
[{
required
:
true
,
message
:
"必选"
,
trigger
:
"change"
}],
trigger
:
"change"
,
}
,
],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}
]
trigger
:
"blur"
,
}
,
],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// phone: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
,
};
},
props
:
{
v
:
Object
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
this
.
$refs
.
form
.
validate
(
(
v
)
=>
{
if
(
v
)
{
if
(
this
.
entity
.
property
)
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
...
...
@@ -186,18 +183,18 @@ export default {
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
//状态
// tenantCode: this.$store.state.userInfo.tenantCode, //商户号
tenantCode
:
util
.
cookies
.
get
(
'tenantCode'
),
//商户号
name
:
this
.
entity
.
userName
tenantCode
:
util
.
cookies
.
get
(
"tenantCode"
),
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms
).
then
(
res
=>
{
Api
.
authAccount
(
parms
).
then
(
(
res
)
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res
.
result
accountId
:
res
.
result
,
};
Api
.
updateAccount
(
parms1
).
then
(
res1
=>
{
Api
.
updateAccount
(
parms1
).
then
(
(
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -214,10 +211,10 @@ export default {
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
// alert(JSON.stringify(err))
console
.
warn
(
err
);
this
.
disabled
=
false
;
this
.
$Message
.
error
(
err
.
error
.
message
);
});
}
...
...
@@ -238,13 +235,13 @@ export default {
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
}
}
,
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
}
}
}
,
}
,
};
</
script
>
...
...
pages/basicData/user/edit.vue
View file @
1980d95c
<
template
>
<div
class=
"addUser"
>
<div
class=
"addUser"
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<span
v-text=
"entity.cardNo"
></span>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
style=
"width:100%"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Row
class=
"rowTitle100"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('cardNo')"
prop=
"cardNo"
>
<span
v-text=
"entity.cardNo"
></span>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"User.base.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('gender')"
prop=
"gender"
>
<Dictionary
code=
"User.base.gender"
v-model=
"entity.gender"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('birthday')"
prop=
"birthday"
>
<DatePicker
type=
"date"
v-model=
"entity.birthday"
style=
"width: 100%"
placeholder=
"请选择"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('degreeId')"
prop=
"degreeId"
>
<Dictionary
code=
"User.base.degree"
v-model=
"entity.degreeId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departmentTitle')"
prop=
"departmentTitle"
>
<DepartmentSelect
v-model=
"entity.departmentId"
@
on-change=
"setDepartmentTitle"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('phone')"
prop=
"phone"
>
<Input
v-model=
"entity.phone"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('email')"
>
<Input
v-model=
"entity.email"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('enableEquip')"
prop=
"enableEquip"
>
<Input
v-model=
"entity.enableEquip"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"用户类型"
>
<Dictionary
code=
"User.base.UserType"
v-model=
"entity.userType"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<Col
:span=
"12"
>
<FormItem
:label=
"l('positionId')"
prop=
"positionId"
>
<Dictionary
code=
"User.base.position"
v-model=
"entity.positionId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('titleId')"
prop=
"titleId"
>
<Dictionary
code=
"User.base.jobtitle"
v-model=
"entity.titleId"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('licensedToWork')"
prop=
"licensedToWork"
>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"用户类型"
>
<Dictionary
code=
"User.base.UserType"
v-model=
"entity.userType"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</div>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
callback
();
}
};
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
showDeptTree
:
false
,
entity
:
{},
rules
:
{
userName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
departmentTitle
:
[{
required
:
true
,
message
:
"必选"
,
trigger
:
"blur"
}],
//cardNo: [{ required: true, message: '必填', trigger: 'blur' }],
// birthday: [{ required: true, message: '必填', trigger: 'change' }],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}]
}
};
},
props
:
{
eid
:
Number
name
:
"Edit"
,
data
()
{
return
{
showDeptTree
:
false
,
entity
:
{},
rules
:
{
userName
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
],
departmentTitle
:
[
{
required
:
true
,
message
:
"必选"
,
trigger
:
"blur"
,
},
],
//cardNo: [{ required: true, message: '必填', trigger: 'blur' }],
// birthday: [{ required: true, message: '必填', trigger: 'change' }],
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
phone
:
[
{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
,
},
],
},
};
},
props
:
{
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
,
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
if
(
r
.
result
.
property
==
2
)
{
this
.
entity
.
property
=
true
;
}
else
{
this
.
entity
.
property
=
false
;
}
this
.
$emit
(
"on-load"
);
});
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
if
(
r
.
result
.
property
==
2
)
{
this
.
entity
.
property
=
true
;
}
else
{
this
.
entity
.
property
=
false
;
}
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
if
((
this
.
entity
.
property
=
true
))
{
this
.
entity
.
property
=
2
;
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
if
((
this
.
entity
.
property
=
true
))
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
if
(
this
.
entity
.
accountId
>
0
)
{
//账户已同步的情况下
let
parms2
=
{
accountId
:
this
.
entity
.
accountId
,
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms2
).
then
((
res
)
=>
{
//同步电话信息等
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
}
else
{
this
.
entity
.
property
=
""
;
this
.
$Message
.
error
(
"账户同步失败"
);
}
});
}
else
{
//账户新建后还未同步成功的情况下
let
parms
=
{
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
,
};
Api
.
authAccount
(
parms
).
then
((
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res1
.
result
,
//账户同步成功后返回的accountId
};
Api
.
updateAccount
(
parms1
).
then
((
res2
)
=>
{
if
(
res2
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
}
else
{
this
.
$Message
.
error
(
"操作失败"
);
}
});
//修改用户表的accountId end
}
Api
.
update
(
this
.
entity
)
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
if
(
this
.
entity
.
accountId
>
0
)
{
//账户已同步的情况下
let
parms2
=
{
accountId
:
this
.
entity
.
accountId
,
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
};
Api
.
authAccount
(
parms2
).
then
(
res
=>
{
//同步电话信息等
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
}
else
{
this
.
$Message
.
error
(
"账户同步失败"
);
}
});
}
else
{
//账户新建后还未同步成功的情况下
let
parms
=
{
userId
:
this
.
entity
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
tenantCode
:
this
.
$store
.
state
.
userInfo
.
tenantCode
,
//商户号
name
:
this
.
entity
.
userName
};
Api
.
authAccount
(
parms
).
then
(
res1
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
let
parms1
=
{
userId
:
parms
.
userId
,
accountId
:
res1
.
result
//账户同步成功后返回的accountId
};
Api
.
updateAccount
(
parms1
).
then
(
res2
=>
{
if
(
res2
.
success
)
{
this
.
$Message
.
success
(
"操作成功"
);
}
else
{
this
.
$Message
.
error
(
"操作失败"
);
}
});
//修改用户表的accountId end
}
});
}
//账户同步操作end
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
});
}
//账户同步操作end
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
if
(
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
}
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
}
});
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
}
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
setDepartmentTitle
(
v
,
item
)
{
if
(
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
;
}
},
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
;
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
<
style
lang=
"less"
>
.addUser {
.ivu-radio-wrapper {
vertical-align: top;
}
.ivu-radio-wrapper {
vertical-align: top;
}
}
</
style
>
pages/exception/add.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('timestamp')"
prop=
"timestamp"
>
<DatePicker
type=
"date"
v-model=
"entity.timestamp"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('messageTemplate')"
prop=
"messageTemplate"
>
<Input
v-model=
"entity.messageTemplate"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('renderedMessage')"
prop=
"renderedMessage"
>
<Input
v-model=
"entity.renderedMessage"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('clientIpAddress')"
prop=
"clientIpAddress"
>
<Input
v-model=
"entity.clientIpAddress"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('loginName')"
prop=
"loginName"
>
<Input
v-model=
"entity.loginName"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tanentCode')"
prop=
"tanentCode"
>
<Input
v-model=
"entity.tanentCode"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('host')"
prop=
"host"
>
<Input
v-model=
"entity.host"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"entity.status"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestUrl')"
prop=
"requestUrl"
>
<InputFile
v-model=
"entity.requestUrl"
></InputFile>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestParam')"
prop=
"requestParam"
>
<Input
v-model=
"entity.requestParam"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('exception')"
prop=
"exception"
>
<Input
v-model=
"entity.exception"
>
</Input>
</FormItem></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('timestamp')"
prop=
"timestamp"
>
<DatePicker
type=
"date"
v-model=
"entity.timestamp"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('messageTemplate')"
prop=
"messageTemplate"
>
<Input
v-model=
"entity.messageTemplate"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('renderedMessage')"
prop=
"renderedMessage"
>
<Input
v-model=
"entity.renderedMessage"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('clientIpAddress')"
prop=
"clientIpAddress"
>
<Input
v-model=
"entity.clientIpAddress"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('loginName')"
prop=
"loginName"
>
<Input
v-model=
"entity.loginName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tanentCode')"
prop=
"tanentCode"
>
<Input
v-model=
"entity.tanentCode"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('host')"
prop=
"host"
>
<Input
v-model=
"entity.host"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"entity.status"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestUrl')"
prop=
"requestUrl"
>
<InputFile
v-model=
"entity.requestUrl"
></InputFile>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestParam')"
prop=
"requestParam"
>
<Input
v-model=
"entity.requestParam"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('exception')"
prop=
"exception"
>
<Input
v-model=
"entity.exception"
>
</Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Add'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
creationTime
:
null
,
creatorUserId
:
null
,
lastModificationTime
:
null
,
lastModifierUserId
:
null
,
isDeleted
:
null
,
deletionTime
:
null
,
deleterUserId
:
null
,
timestamp
:
null
,
level
:
""
,
messageTemplate
:
""
,
renderedMessage
:
""
,
clientIpAddress
:
""
,
loginName
:
""
,
tanentCode
:
""
,
host
:
""
,
status
:
""
,
requestUrl
:
""
,
requestParam
:
""
,
exception
:
""
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
v
:
Object
,
eid
:
Number
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
},
l
(
key
)
{
key
=
"run_log"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
}
}
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{
creationTime
:
null
,
creatorUserId
:
null
,
lastModificationTime
:
null
,
lastModifierUserId
:
null
,
isDeleted
:
null
,
deletionTime
:
null
,
deleterUserId
:
null
,
timestamp
:
null
,
level
:
""
,
messageTemplate
:
""
,
renderedMessage
:
""
,
clientIpAddress
:
""
,
loginName
:
""
,
tanentCode
:
""
,
host
:
""
,
status
:
""
,
requestUrl
:
""
,
requestParam
:
""
,
exception
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
v
:
Object
,
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
</
script
>
\ No newline at end of file
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
},
l
(
key
)
{
key
=
"run_log"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/exception/detail.vue
View file @
1980d95c
...
...
@@ -53,9 +53,7 @@
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -76,7 +74,6 @@ export default {
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
disabled
:
false
,
};
},
props
:
{
...
...
@@ -105,14 +102,12 @@ export default {
return
this
.
$t
(
key
);
},
handleSubmit
()
{
this
.
disabled
=
true
;
Api
.
update
({
id
:
this
.
entity
.
id
,
status
:
this
.
entity
.
status
,
remark
:
this
.
entity
.
remark
,
})
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -121,7 +116,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
cosole
.
warn
(
err
);
});
...
...
pages/exception/edit.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('timestamp')"
prop=
"timestamp"
>
<DatePicker
type=
"date"
v-model=
"entity.timestamp"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('messageTemplate')"
prop=
"messageTemplate"
>
<Input
v-model=
"entity.messageTemplate"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('renderedMessage')"
prop=
"renderedMessage"
>
<Input
v-model=
"entity.renderedMessage"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('clientIpAddress')"
prop=
"clientIpAddress"
>
<Input
v-model=
"entity.clientIpAddress"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('loginName')"
prop=
"loginName"
>
<Input
v-model=
"entity.loginName"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tanentCode')"
prop=
"tanentCode"
>
<Input
v-model=
"entity.tanentCode"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('host')"
prop=
"host"
>
<Input
v-model=
"entity.host"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"entity.status"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestUrl')"
prop=
"requestUrl"
>
<InputFile
v-model=
"entity.requestUrl"
></InputFile>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestParam')"
prop=
"requestParam"
>
<Input
v-model=
"entity.requestParam"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('exception')"
prop=
"exception"
>
<Input
v-model=
"entity.exception"
>
</Input>
</FormItem></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('timestamp')"
prop=
"timestamp"
>
<DatePicker
type=
"date"
v-model=
"entity.timestamp"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('messageTemplate')"
prop=
"messageTemplate"
>
<Input
v-model=
"entity.messageTemplate"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('renderedMessage')"
prop=
"renderedMessage"
>
<Input
v-model=
"entity.renderedMessage"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('clientIpAddress')"
prop=
"clientIpAddress"
>
<Input
v-model=
"entity.clientIpAddress"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('loginName')"
prop=
"loginName"
>
<Input
v-model=
"entity.loginName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tanentCode')"
prop=
"tanentCode"
>
<Input
v-model=
"entity.tanentCode"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('host')"
prop=
"host"
>
<Input
v-model=
"entity.host"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"entity.status"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestUrl')"
prop=
"requestUrl"
>
<InputFile
v-model=
"entity.requestUrl"
></InputFile>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('requestParam')"
prop=
"requestParam"
>
<Input
v-model=
"entity.requestParam"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('exception')"
prop=
"exception"
>
<Input
v-model=
"entity.exception"
>
</Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Edit'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
eid
:
Number
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
})
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"run_log"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
}
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"run_log"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/data_source/add.vue
View file @
1980d95c
...
...
@@ -19,9 +19,7 @@
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
...
...
@@ -32,7 +30,6 @@ export default {
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
...
...
@@ -46,10 +43,8 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
...
...
@@ -58,7 +53,6 @@ export default {
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
...
...
pages/system/data_source/edit.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"24"
><FormItem
:label=
"l('hostId')"
prop=
"hostId"
>
<Dictionary
v-model=
"entity.hostId"
></Dictionary>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('port')"
prop=
"port"
>
<InputNumber
v-model=
"entity.port"
></InputNumber>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('password')"
prop=
"password"
>
<Input
v-model=
"entity.password"
>
</Input>
</FormItem></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"24"
><FormItem
:label=
"l('hostId')"
prop=
"hostId"
>
<Dictionary
v-model=
"entity.hostId"
></Dictionary>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('port')"
prop=
"port"
>
<InputNumber
v-model=
"entity.port"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('password')"
prop=
"password"
>
<Input
v-model=
"entity.password"
>
</Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Edit'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
eid
:
Number
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
'on-load'
)
})
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"data_source"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"data_source"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/atom/add.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Row
v-if=
"upDrop"
>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<Row>
<Col
:span=
"24"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
</Row>
<Row
style=
"margin-top: 10px"
>
<Tabs>
<TabPane
label=
"实体定义"
name=
"base"
>
</TabPane>
<!--
<TabPane
v-for=
"tab in dtos"
:key=
"tab.code"
:label=
"tab.name"
>
</TabPane>
-->
<!--
<Button
@
click=
"modal1 = true"
size=
"small"
slot=
"extra"
>
增加
</Button
>
-->
<!--
<Modal
v-model=
"modal1"
title=
"增加"
@
on-ok=
"okModal('formline')"
@
on-cancel=
"cancelModal('formline')"
>
<Form
:model=
"formline"
ref=
"formline"
:rules=
"ruleInline"
:label-width=
"80"
>
<p>
<FormItem
label=
"名称:"
prop=
"name"
>
<Input
v-model=
"formline.name"
placeholder=
"请输入名称"
></Input>
</FormItem>
</p>
<p>
<FormItem
label=
"编码:"
prop=
"code"
>
<Input
v-model=
"formline.code"
placeholder=
"请输入编码"
></Input>
</FormItem>
</p>
</Form>
</Modal>
-->
</Tabs>
</Row>
<Row>
<Row
style=
"margin-bottom: 10px"
:gutter=
"10"
>
<Col
:span=
"6"
>
<AutoComplete
v-model=
"completeValue"
icon=
"ios-search"
placeholder=
"请搜索"
style=
"width: 100%"
>
<Option
v-for=
"option in completeList"
:value=
"option.name"
:key=
"option.id"
>
<span
class=
"demo-auto-complete-title"
>
{{
option
.
name
}}
</span>
<span
class=
"demo-auto-complete-count"
style=
"float: right"
>
{{
option
.
code
}}
</span
>
</Option>
</AutoComplete>
</Col>
<Col
:span=
"2"
>
<Button
type=
"primary"
@
click=
"importColumns"
>
导入
</Button>
</Col>
</Row>
<Table
:columns=
"columns1"
:data=
"checkList"
border
:draggable=
"true"
@
on-drag-drop=
"onDragDrop"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<Input
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<Input
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dbColumnName"
>
<Input
v-model=
"row.dbColumnName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.code"
:disabled=
"row.dataType != 3 && row.dataType != 10"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isNullable"
>
<Checkbox
v-model=
"row.isNullable"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unit"
>
<Dictionary
:disabled=
"row.dataType != 0 && row.dataType != 8"
@
on-change=
"setRow(row, index)"
v-model=
"row.unit"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"length"
>
<Input
:disabled=
"row.dataType != 0 && row.dataType != 8"
v-model=
"row.length"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<!-- <template slot-scope="{ row, index }" slot="link">
<Input
v-model="row.link"
@on-change="setRow(row, index)"
placeholder="请输入"
number
/>
</template> -->
<
template
slot-scope=
"{ row, index }"
slot=
"systemName"
>
<state
code=
"project.main.systemName"
:value=
"row.systemName"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"list"
>
<Checkbox
v-model=
"row.list"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"add"
>
<Checkbox
v-model=
"row.add"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"uniqueness"
>
<Checkbox
v-model=
"row.uniqueness"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"defaultValue"
>
<Input
v-model=
"row.defaultValue"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
</Row>
</Col>
<Col
:span=
"24"
class=
"tr mt10"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Row>
</Form>
</template>
<
script
>
import
Dtos
from
"./dtos"
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
systemValue
:
0
,
columns1
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
70
,
align
:
"center"
,
},
{
title
:
"名称(*)"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
width
:
150
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
150
,
high
:
true
,
},
{
title
:
"字段名称"
,
key
:
"dbColumnName"
,
align
:
"center"
,
slot
:
"dbColumnName"
,
width
:
150
,
high
:
true
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"字段名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"属性(*)"
,
align
:
"center"
,
key
:
"propertyName"
,
slot
:
"propertyName"
,
high
:
false
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"属性("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"关联"
,
key
:
"code"
,
align
:
"center"
,
slot
:
"code"
,
},
{
title
:
"单位"
,
key
:
"unit"
,
align
:
"center"
,
slot
:
"unit"
,
},
{
title
:
"长度"
,
key
:
"length"
,
align
:
"center"
,
slot
:
"length"
,
},
{
title
:
"业务类型"
,
key
:
"systemName"
,
align
:
"center"
,
slot
:
"systemName"
,
width
:
190
,
},
{
title
:
"是否可空"
,
key
:
"isNullable"
,
align
:
"center"
,
slot
:
"isNullable"
,
width
:
100
,
},
{
title
:
"业务设置"
,
align
:
"center"
,
children
:
[
{
title
:
"列表"
,
key
:
"list"
,
align
:
"center"
,
slot
:
"list"
,
width
:
70
,
},
{
title
:
"新增"
,
key
:
"add"
,
align
:
"center"
,
slot
:
"add"
,
width
:
70
,
},
{
title
:
"唯一"
,
key
:
"uniqueness"
,
align
:
"center"
,
slot
:
"uniqueness"
,
width
:
70
,
},
{
title
:
"默认值"
,
key
:
"defaultValue"
,
align
:
"center"
,
slot
:
"defaultValue"
,
},
],
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
disabled
:
false
,
entity
:
{
name
:
""
,
upId
:
null
,
level
:
null
,
tenantId
:
null
,
type
:
null
,
englishFullName
:
""
,
englishName
:
""
,
status
:
null
,
description
:
""
,
inheritCategoryId
:
null
,
code
:
""
,
module
:
""
,
version
:
null
,
projectId
:
null
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
// content:{
// base:[]
// },
dtos
:[]
};
},
components
:{
Dtos
},
props
:
{
v
:
Object
,
eid
:
Number
,
},
mounted
()
{
this
.
seachChange
();
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
onDragDrop
(
a
,
b
)
{
this
.
checkList
.
splice
(
b
,
0
,
...
this
.
checkList
.
splice
(
a
,
1
));
},
importColumns
()
{
//导入
let
changeId
=
{};
if
(
this
.
completeList
.
length
>
0
)
{
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
e
.
name
==
this
.
completeValue
)
{
changeId
=
e
;
this
.
completeList
.
splice
(
index
,
1
);
this
.
completeValue
=
""
;
}
});
this
.
addNew
(
1
,
changeId
);
}
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
});
},
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
//新增的删除,直接删
this
.
checkList
.
splice
(
index
,
1
);
// let objArr = {
// name: row.columnDescription,
// code: row.code,
// id: row.id,
// };
// this.completeList.push(objArr);
}
else
{
row
.
action
=
2
;
//返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this
.
$set
(
this
.
checkList
,
index
,
row
);
this
.
arr
.
push
(
row
);
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
(
row
,
index
)
{
if
(
row
.
dataType
==
0
||
row
.
dataType
==
8
)
{
row
.
length
=
50
;
}
else
{
row
.
length
=
0
;
}
if
(
row
.
dbColumnName
==
""
)
{
row
.
propertyName
=
row
.
dbColumnName
;
}
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
(
index
,
e
)
{
let
name
=
""
,
flag
=
false
;
if
(
index
==
0
&&
e
==
"{}"
)
{
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
flag
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
flag
=
true
);
}
});
if
(
flag
==
true
)
{
return
;
}
let
obj
=
{
dbColumnName
:
""
,
systemName
:
this
.
systemValue
,
columnDescription
:
name
,
defaultValue
:
""
,
isNullable
:
false
,
unit
:
0
,
link
:
0
,
dataType
:
0
,
isKey
:
false
,
// 是否主键
length
:
50
,
propertyName
:
""
,
//程序中的字段名称
propertyType
:
""
,
// 程序中的字段类型
fieldType
:
3
,
action
:
1
,
add
:
0
,
//新增标识
};
this
.
checkList
.
push
(
obj
);
}
else
if
(
index
==
1
&&
JSON
.
stringify
(
e
)
!=
"{}"
)
{
JSON
.
parse
(
e
.
content
).
map
((
item
)
=>
{
this
.
checkList
.
push
(
item
);
});
}
else
{
this
.
$Message
.
warning
(
"请选择导入字段!"
);
return
;
}
},
handleSubmit
()
{
let
keys
=
false
;
let
name
=
""
;
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
keys
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
keys
=
true
);
}
});
if
(
this
.
checkList
.
length
>=
2
)
{
for
(
var
i
=
1
;
i
<
this
.
checkList
.
length
;
i
++
)
{
if
(
this
.
checkList
[
0
].
columnDescription
==
this
.
checkList
[
i
].
columnDescription
)
{
this
.
$Message
.
error
(
"表格名称重复!"
);
return
(
keys
=
true
);
}
if
(
this
.
checkList
[
0
].
propertyName
==
this
.
checkList
[
i
].
propertyName
)
{
this
.
$Message
.
error
(
"表格属性重复!"
);
return
(
keys
=
true
);
}
}
}
if
(
keys
==
true
)
{
return
;
}
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
content
=
this
.
checkList
;
this
.
entity
.
id
=
0
;
});
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
"entity.type"
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
==
0
)
{
this
.
systemValue
=
0
;
}
else
if
(
newVal
==
1
)
{
this
.
systemValue
=
1
;
}
},
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
<
style
scoped
>
.textIcon
{
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#2d8cf0
;
border-radius
:
4px
;
text-align
:
center
;
color
:
#ffffff
;
}
.textIcon
:hover
{
opacity
:
0.7
;
}
</
style
>
>
pages/system/project/atom/api.js
deleted
100644 → 0
View file @
736da3b1
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
systemUrl
}
/projectatom/paged`
,
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/paged`
,
params
);
},
list
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/list`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/projectatom/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/create`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
systemUrl
}
/projectatom/delete`
,
{
params
:
{
id
:
id
}
});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/batchdelete`
,
params
);
}
}
\ No newline at end of file
pages/system/project/atom/detail.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div
class=
"detail"
>
<Row
v-if=
"upDrop"
>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('level')"
>
{{
entity
.
level
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
>
{{
entity
.
type
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishFullName')"
>
{{
entity
.
englishFullName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishName')"
>
{{
entity
.
englishName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('status')"
>
{{
entity
.
status
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('module')"
>
{{
entity
.
module
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('version')"
>
{{
entity
.
version
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('description')"
>
{{
entity
.
description
}}
</Filed>
</Row>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
</Row>
<Row>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
<Table
:columns=
"columns"
:data=
"checkList"
border
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div>
{{
row
.
title
}}
</div>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<Select
v-model=
"row.note"
clearable
transfer
disabled
>
<Option
v-for=
"item in codeList"
:value=
"item.code"
:key=
"item.code"
>
{{
item
.
name
}}
</Option
>
</Select>
<span>
{{
row
.
note
}}
</span>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
disabled
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unitName"
>
<Dictionary
disabled
v-model=
"row.unitName"
code=
"material.main.unitName"
type=
"select"
placeholder=
"请选择单位"
:value=
"row.unitName"
:key=
"row.unitName"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
{{
row
.
required
}}
<!--
<Checkbox
v-model=
"row.required"
disabled
></Checkbox>
-->
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isUnique"
>
{{
row
.
isUnique
}}
<!--
<Checkbox
v-model=
"row.isUnique"
disabled
></Checkbox>
-->
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a>
</
template
>
</Table>
</Row>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
columns
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
80
,
align
:
"center"
,
},
{
title
:
"属性名称"
,
key
:
"title"
,
slot
:
"title"
,
},
{
title
:
"属性类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
200
,
},
{
title
:
"设置"
,
key
:
"note"
,
align
:
"center"
,
slot
:
"note"
,
},
{
title
:
"单位"
,
key
:
"unitName"
,
align
:
"center"
,
slot
:
"unitName"
,
width
:
"150"
,
},
{
title
:
"必填"
,
key
:
"required"
,
align
:
"center"
,
slot
:
"required"
,
width
:
80
,
},
{
title
:
"唯一"
,
key
:
"isUnique"
,
align
:
"center"
,
slot
:
"isUnique"
,
width
:
80
,
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
this
.
seachChange
();
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
checkList
=
JSON
.
parse
(
r
.
result
.
content
);
console
.
log
(
this
.
checkList
);
this
.
checkList
.
map
((
v
)
=>
{
if
(
v
.
fieldType
>
1
)
{
v
.
fieldType
=
1
;
}
});
this
.
$emit
(
"on-load"
);
});
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
})
.
catch
((
err
)
=>
{});
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
<
style
scoped
>
.textIcon
{
margin-top
:
10px
;
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#2d8cf0
;
border-radius
:
4px
;
text-align
:
center
;
color
:
#ffffff
;
}
.textIcon
:hover
{
opacity
:
0.7
;
}
</
style
>
>
\ No newline at end of file
pages/system/project/atom/dtos/index.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div>
<Row
style=
"margin-bottom: 10px"
:gutter=
"10"
>
<Col
:span=
"6"
>
<AutoComplete
v-model=
"completeValue"
icon=
"ios-search"
placeholder=
"请搜索"
style=
"width: 100%"
>
<Option
v-for=
"option in completeList"
:value=
"option.name"
:key=
"option.code"
>
<span
class=
"demo-auto-complete-title"
>
{{
option
.
name
}}
</span>
<span
class=
"demo-auto-complete-count"
style=
"float: right"
>
{{
option
.
code
}}
</span>
</Option>
</AutoComplete>
</Col>
<Col
:span=
"2"
>
<Button
type=
"primary"
@
click=
"importColumns"
>
导入
</Button>
</Col>
</Row>
<Table
:columns=
"columns1"
:data=
"checkList"
border
:draggable=
"true"
@
on-drag-drop=
"onDragDrop"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<Input
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<Input
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dbColumnName"
>
<Input
v-model=
"row.dbColumnName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.code"
:disabled=
"row.dataType != 3 && row.dataType != 10"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isNullable"
>
<Checkbox
v-model=
"row.isNullable"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unit"
>
<Dictionary
:disabled=
"row.dataType != 0 && row.dataType != 8"
@
on-change=
"setRow(row, index)"
v-model=
"row.unit"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"length"
>
<Input
:disabled=
"row.dataType != 0 && row.dataType != 8"
v-model=
"row.length"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<!--
<template slot-scope="{ row, index }" slot="link">
<Input
v-model="row.link"
@on-change="setRow(row, index)"
placeholder="请输入"
number
/>
</template> -->
<
template
slot-scope=
"{ row, index }"
slot=
"systemName"
>
<state
code=
"project.main.systemName"
:value=
"row.systemName"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"list"
>
<Checkbox
v-model=
"row.list"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"add"
>
<Checkbox
v-model=
"row.add"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"uniqueness"
>
<Checkbox
v-model=
"row.uniqueness"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"defaultValue"
>
<Input
v-model=
"row.defaultValue"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
</div>
</template>
<
script
>
export
default
{
// name: '',
data
()
{
return
{
checkList
:
this
.
list
,
completeValue
:
""
,
completeList
:
[],
columns1
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
70
,
align
:
"center"
,
},
{
title
:
"名称(*)"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
width
:
150
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
150
,
high
:
true
,
},
{
title
:
"字段名称"
,
key
:
"dbColumnName"
,
align
:
"center"
,
slot
:
"dbColumnName"
,
width
:
150
,
high
:
true
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"字段名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"属性(*)"
,
align
:
"center"
,
key
:
"propertyName"
,
slot
:
"propertyName"
,
high
:
false
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"属性("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"关联"
,
key
:
"code"
,
align
:
"center"
,
slot
:
"code"
,
},
{
title
:
"单位"
,
key
:
"unit"
,
align
:
"center"
,
slot
:
"unit"
,
},
{
title
:
"长度"
,
key
:
"length"
,
align
:
"center"
,
slot
:
"length"
,
},
{
title
:
"业务类型"
,
key
:
"systemName"
,
align
:
"center"
,
slot
:
"systemName"
,
width
:
190
,
},
{
title
:
"是否可空"
,
key
:
"isNullable"
,
align
:
"center"
,
slot
:
"isNullable"
,
width
:
100
,
},
{
title
:
"业务设置"
,
align
:
"center"
,
children
:
[
{
title
:
"列表"
,
key
:
"list"
,
align
:
"center"
,
slot
:
"list"
,
width
:
70
,
},
{
title
:
"新增"
,
key
:
"add"
,
align
:
"center"
,
slot
:
"add"
,
width
:
70
,
},
{
title
:
"唯一"
,
key
:
"uniqueness"
,
align
:
"center"
,
slot
:
"uniqueness"
,
width
:
70
,
},
{
title
:
"默认值"
,
key
:
"defaultValue"
,
align
:
"center"
,
slot
:
"defaultValue"
,
},
],
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
};
},
props
:
{
list
:
Array
,
default
:()
=>
{
return
[]
}
},
created
()
{
},
methods
:
{
importColumns
()
{
//导入
let
changeId
=
{};
if
(
this
.
completeList
.
length
>
0
)
{
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
e
.
name
==
this
.
completeValue
)
{
changeId
=
e
;
this
.
completeList
.
splice
(
index
,
1
);
this
.
completeValue
=
""
;
}
});
this
.
addNew
(
1
,
changeId
);
}
},
onDragDrop
(
a
,
b
)
{
this
.
checkList
.
splice
(
b
,
0
,
...
this
.
checkList
.
splice
(
a
,
1
));
},
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
//新增的删除,直接删
this
.
checkList
.
splice
(
index
,
1
);
let
objArr
=
{
name
:
row
.
title
,
code
:
row
.
code
,
id
:
row
.
id
,
};
this
.
completeList
.
push
(
objArr
);
}
else
{
row
.
action
=
2
;
//返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this
.
$set
(
this
.
checkList
,
index
,
row
);
this
.
arr
.
push
(
row
);
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
(
row
,
index
)
{
console
.
log
(
row
.
list
);
if
(
row
.
list
==
true
)
{
this
.
dtos
[
0
].
list
.
push
(
row
);
}
else
{
this
.
dtos
[
0
].
list
.
map
((
q
,
i
)
=>
{
if
(
q
.
propertyName
==
row
.
propertyName
)
{
this
.
dtos
[
0
].
list
.
splice
(
i
,
1
);
}
});
}
console
.
log
(
this
.
dtos
[
0
].
list
);
if
(
row
.
dataType
==
0
||
row
.
dataType
==
8
)
{
row
.
length
=
50
;
}
else
{
row
.
length
=
0
;
}
if
(
row
.
dbColumnName
==
""
)
{
row
.
propertyName
=
row
.
dbColumnName
;
}
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
(
index
,
e
)
{
let
name
=
""
,
flag
=
false
;
if
(
index
==
0
&&
e
==
"{}"
)
{
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
flag
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
flag
=
true
);
}
});
if
(
flag
==
true
)
{
return
;
}
let
obj
=
{
dbColumnName
:
""
,
systemName
:
this
.
systemValue
,
columnDescription
:
name
,
defaultValue
:
""
,
isNullable
:
false
,
unit
:
0
,
link
:
0
,
dataType
:
0
,
isKey
:
false
,
// 是否主键
length
:
50
,
propertyName
:
""
,
//程序中的字段名称
propertyType
:
""
,
// 程序中的字段类型
fieldType
:
3
,
action
:
1
,
add
:
0
,
//新增标识
};
this
.
checkList
.
push
(
obj
);
}
else
if
(
index
==
1
&&
JSON
.
stringify
(
e
)
!=
"{}"
)
{
JSON
.
parse
(
e
.
content
).
map
((
item
)
=>
{
this
.
checkList
.
push
(
item
);
});
}
else
{
this
.
$Message
.
warning
(
"请选择导入字段!"
);
return
;
}
},
},
watch
:{
list
(
v
){
this
.
checkList
=
v
;
}
}
};
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
pages/system/project/atom/dtos/inputDto.vue
deleted
100644 → 0
View file @
736da3b1
pages/system/project/atom/dtos/outDto.vue
deleted
100644 → 0
View file @
736da3b1
pages/system/project/atom/edit.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Row
v-if=
"upDrop"
>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
type=
"radio"
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<Col
:span=
"24"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
</Row>
<Row
style=
"margin-top: 10px"
>
<Tabs
type=
"card"
v-model=
"currTab"
@
on-click=
"handleContextMenu"
>
<TabPane
label=
"实体定义"
name=
"base"
>
</TabPane>
<TabPane
v-for=
"tab in dtos"
:key=
"tab.code"
:label=
"tab.name"
:name=
"tab.code"
></TabPane>
<Button
@
click=
"modal1 = true"
size=
"small"
slot=
"extra"
style=
"margin-right: 10px;"
>
增加
</Button>
<Button
size=
"small"
slot=
"extra"
>
默认增加
</Button>
<Modal
v-model=
"modal1"
title=
"增加"
@
on-ok=
"okModal('formline')"
@
on-cancel=
"cancelModal('formline')"
>
<Form
:model=
"formline"
ref=
"formline"
:rules=
"ruleInline"
:label-width=
"80"
>
<p>
<FormItem
label=
"名称:"
prop=
"name"
>
<Input
v-model=
"formline.name"
placeholder=
"请输入名称"
></Input>
</FormItem>
</p>
<p>
<FormItem
label=
"编码:"
prop=
"code"
>
<Input
v-model=
"formline.code"
placeholder=
"请输入编码"
></Input>
</FormItem>
</p>
</Form>
</Modal>
</Tabs>
</Row>
<!--
<Row
style=
"margin-bottom: 10px"
:gutter=
"10"
>
<Col
:span=
"6"
>
<AutoComplete
v-model=
"completeValue"
icon=
"ios-search"
placeholder=
"请搜索"
style=
"width: 100%"
>
<Option
v-for=
"option in completeList"
:value=
"option.name"
:key=
"option.code"
>
<span
class=
"demo-auto-complete-title"
>
{{
option
.
name
}}
</span>
<span
class=
"demo-auto-complete-count"
style=
"float: right"
>
{{
option
.
code
}}
</span>
</Option>
</AutoComplete>
</Col>
<Col
:span=
"2"
>
<Button
type=
"primary"
@
click=
"importColumns"
>
导入
</Button>
</Col>
</Row>
<Table
:columns=
"columns1"
:data=
"checkList"
border
:draggable=
"true"
@
on-drag-drop=
"onDragDrop"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<Input
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<Input
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dbColumnName"
>
<Input
v-model=
"row.dbColumnName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.code"
:disabled=
"row.dataType != 3 && row.dataType != 10"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isNullable"
>
<Checkbox
v-model=
"row.isNullable"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unit"
>
<Dictionary
:disabled=
"row.dataType != 0 && row.dataType != 8"
@
on-change=
"setRow(row, index)"
v-model=
"row.unit"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"length"
>
<Input
:disabled=
"row.dataType != 0 && row.dataType != 8"
v-model=
"row.length"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"link"
>
<Input
v-model=
"row.link"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
number
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"systemName"
>
<state
code=
"project.main.systemName"
:value=
"row.systemName"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"list"
>
<Checkbox
v-model=
"row.list"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"add"
>
<Checkbox
v-model=
"row.add"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"uniqueness"
>
<Checkbox
v-model=
"row.uniqueness"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"defaultValue"
>
<Input
v-model=
"row.defaultValue"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button>
-->
<!-- <Dtos :list="checkList"></Dtos> -->
<component
:is=
"detail"
:list=
"checkList"
/>
</Col>
<Col
:span=
"24"
class=
"tr mt10"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
currTab
:
'base'
,
detail
:
null
,
contextData
:
null
,
formline
:
{
name
:
""
,
code
:
""
,
},
ruleInline
:
{
name
:
[{
required
:
true
,
message
:
"请输入名称"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"请输入编码"
,
trigger
:
"blur"
}],
},
modal1
:
false
,
content
:
{
base
:
[],
},
dtos
:
[
{
name
:
"列表"
,
code
:
"list"
,
type
:
0
,
list
:
[],
},
{
name
:
"新增"
,
code
:
"Add"
,
type
:
1
,
list
:
[],
},
{
name
:
"编辑"
,
code
:
"Edit"
,
type
:
1
,
list
:
[],
},
{
name
:
"查询"
,
code
:
"Search"
,
type
:
1
,
list
:
[],
},
],
systemValue
:
0
,
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
columns1
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
70
,
align
:
"center"
,
},
{
title
:
"名称(*)"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
width
:
150
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
150
,
high
:
true
,
},
{
title
:
"字段名称"
,
key
:
"dbColumnName"
,
align
:
"center"
,
slot
:
"dbColumnName"
,
width
:
150
,
high
:
true
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"字段名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"属性(*)"
,
align
:
"center"
,
key
:
"propertyName"
,
slot
:
"propertyName"
,
high
:
false
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"属性("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"关联"
,
key
:
"code"
,
align
:
"center"
,
slot
:
"code"
,
},
{
title
:
"单位"
,
key
:
"unit"
,
align
:
"center"
,
slot
:
"unit"
,
},
{
title
:
"长度"
,
key
:
"length"
,
align
:
"center"
,
slot
:
"length"
,
},
{
title
:
"业务类型"
,
key
:
"systemName"
,
align
:
"center"
,
slot
:
"systemName"
,
width
:
190
,
},
{
title
:
"是否可空"
,
key
:
"isNullable"
,
align
:
"center"
,
slot
:
"isNullable"
,
width
:
100
,
},
{
title
:
"业务设置"
,
align
:
"center"
,
children
:
[
{
title
:
"列表"
,
key
:
"list"
,
align
:
"center"
,
slot
:
"list"
,
width
:
70
,
},
{
title
:
"新增"
,
key
:
"add"
,
align
:
"center"
,
slot
:
"add"
,
width
:
70
,
},
{
title
:
"唯一"
,
key
:
"uniqueness"
,
align
:
"center"
,
slot
:
"uniqueness"
,
width
:
70
,
},
{
title
:
"默认值"
,
key
:
"defaultValue"
,
align
:
"center"
,
slot
:
"defaultValue"
,
},
],
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
disabled
:
false
,
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
this
.
seachChange
();
}
this
.
detail
=
()
=>
import
(
'./dtos'
)
},
methods
:
{
handleContextMenu
(
data
)
{
console
.
log
(
"+========================="
)
console
.
log
(
data
)
this
.
contextData
=
data
;
},
okModal
(
name
)
{
this
.
$refs
[
name
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
obj
=
{
name
:
this
.
formline
.
name
,
code
:
this
.
formline
.
code
,
list
:
[],
};
this
.
dtos
.
push
(
obj
);
console
.
log
(
this
.
dtos
);
this
.
$refs
[
name
].
resetFields
();
this
.
modal1
=
false
;
}
});
},
cancelModal
(
name
)
{
this
.
$refs
[
name
].
resetFields
();
this
.
modal1
=
false
;
},
// importColumns() {
// //导入
// let changeId = {};
// if (this.completeList.length > 0) {
// this.completeList.map((e, index) => {
// if (e.name == this.completeValue) {
// changeId = e;
// this.completeList.splice(index, 1);
// this.completeValue = "";
// }
// });
// this.addNew(1, changeId);
// }
// },
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
})
.
catch
((
err
)
=>
{});
},
// onDragDrop(a, b) {
// this.checkList.splice(b, 0, ...this.checkList.splice(a, 1));
// },
// remove(index, row) {
// if (row.add == 0) {
// //新增的删除,直接删
// this.checkList.splice(index, 1);
// let objArr = {
// name: row.title,
// code: row.code,
// id: row.id,
// };
// this.completeList.push(objArr);
// } else {
// row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
// this.$set(this.checkList, index, row);
// this.arr.push(row);
// this.checkList.splice(index, 1);
// }
// },
// setRow(row, index) {
// console.log(row.list)
// if(row.list==true){
// this.dtos[0].list.push(row)
// }else{
// this.dtos[0].list.map((q,i)=>{
// if(q.propertyName==row.propertyName){
// this.dtos[0].list.splice(i,1)
// }
// })
// }
// console.log(this.dtos[0].list)
// if (row.dataType == 0 || row.dataType == 8) {
// row.length = 50;
// } else {
// row.length = 0;
// }
// if (row.dbColumnName == "") {
// row.propertyName = row.dbColumnName;
// }
// this.$set(this.checkList, index, row);
// },
// addNew(index, e) {
// let name = "",
// flag = false;
// if (index == 0 && e == "{}") {
// this.checkList.forEach((s, index) => {
// if (s.columnDescription == "") {
// this.$Message.warning("请填写表格名称!");
// return (flag = true);
// }
// if (s.propertyName == "") {
// this.$Message.warning("请填写表格属性!");
// return (flag = true);
// }
// });
// if (flag == true) {
// return;
// }
// let obj = {
// dbColumnName: "",
// systemName: this.systemValue,
// columnDescription: name,
// defaultValue: "",
// isNullable: false,
// unit: 0,
// link: 0,
// dataType: 0,
// isKey: false, // 是否主键
// length: 50,
// propertyName: "", //程序中的字段名称
// propertyType: "", // 程序中的字段类型
// fieldType: 3,
// action: 1,
// add: 0, //新增标识
// };
// this.checkList.push(obj);
// } else if (index == 1 && JSON.stringify(e) != "{}") {
// JSON.parse(e.content).map((item) => {
// this.checkList.push(item);
// });
// } else {
// this.$Message.warning("请选择导入字段!");
// return;
// }
// },
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
checkList
=
JSON
.
parse
(
r
.
result
.
content
);
console
.
log
(
this
.
checkList
)
this
.
checkList
.
map
((
v
)
=>
{
if
(
v
.
fieldType
>
1
)
{
v
.
fieldType
=
1
;
}
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
v
.
title
==
e
.
name
)
{
this
.
completeList
.
splice
(
index
,
1
);
}
});
});
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
"entity.type"
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
==
0
)
{
this
.
systemValue
=
0
;
}
else
if
(
newVal
==
1
)
{
this
.
systemValue
=
1
;
}
},
// eid(v) {
// if (v != 0) {
// this.load(v);
// }
// },
},
};
</
script
>
<
style
scoped
>
.textIcon
{
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#2d8cf0
;
border-radius
:
4px
;
text-align
:
center
;
color
:
#ffffff
;
}
.textIcon
:hover
{
opacity
:
0.7
;
}
</
style
>
>
\ No newline at end of file
pages/system/project/atom/index.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
><template
slot=
"easySearch"
><Form
ref=
"formInline"
:model=
"easySearch"
inline
><FormItem
prop=
"keys"
><Input
placeholder=
"请输入关键字名称/英文全称/英文简称/编码"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem
>
</Form></
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
</DataGrid>
<!-- fullscreen -->
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
fullscreen
>
<component
:is=
"detail"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
"项目对象"
,
author
:
"henq"
,
description
:
"project_atom 10/14/2020 11:41:27 AM"
,
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"name,englishFullName,englishName,code"
,
value
:
null
},
},
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
columns
:
[
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
},
{
key
:
"name"
,
title
:
this
.
l
(
"name"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project_atom.status"
,
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project_atom.type"
,
},
{
key
:
"englishFullName"
,
title
:
this
.
l
(
"englishFullName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"englishName"
,
title
:
this
.
l
(
"englishName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"module"
,
title
:
this
.
l
(
"module"
),
align
:
"left"
,
high
:
true
},
{
key
:
"version"
,
title
:
this
.
l
(
"version"
),
align
:
"left"
,
high
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
.
id
)
},
},
"查看"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
},
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
},
},
"删除"
),
]);
},
},
],
};
},
mounted
()
{},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
l
(
key
)
{
/*
project_atom:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
content:'内容',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
version:'版本',
projectId:'项目',
}
*/
let
vkey
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
pages/system/project/atom/search.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"condition"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
:v-if=
"condition.id.show"
><FormItem
:label=
"$t('id')"
prop=
"id"
>
<Input
v-model=
"condition.id.value"
number
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creationTime.show"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.creationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creatorUserId.show"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<Input
v-model=
"condition.creatorUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModificationTime.show"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.lastModificationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModifierUserId.show"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<Input
v-model=
"condition.lastModifierUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.deletionTime.show"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.deletionTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.name.show"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"condition.name.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.upId.show"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<Input
v-model=
"condition.upId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.level.show"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"condition.level.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.tenantId.show"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<Input
v-model=
"condition.tenantId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.type.show"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Input
v-model=
"condition.type.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishFullName.show"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"condition.englishFullName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishName.show"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"condition.englishName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.status.show"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"condition.status.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
:v-if=
"condition.description.show"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"condition.description.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.inheritCategoryId.show"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<Input
v-model=
"condition.inheritCategoryId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.code.show"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"condition.code.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.module.show"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"condition.module.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.version.show"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<Input
v-model=
"condition.version.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.projectId.show"
><FormItem
:label=
"l('projectId')"
prop=
"projectId"
>
<Input
v-model=
"condition.projectId.value"
>
</Input>
</FormItem
></Col>
</Row>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
condition
:
{
id
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
creationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
creatorUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
lastModificationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
lastModifierUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
deletionTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
name
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
upId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
level
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
tenantId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
type
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishFullName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
status
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
description
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
inheritCategoryId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
code
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
module
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
version
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
projectId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
},
};
},
methods
:
{
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/index.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div
id=
'sysproject'
>
<div
class=
"tree_left"
>
<Project></Project>
</div>
<div
class=
"count_right"
>
<Atom></Atom>
</div>
</div>
</
template
>
<
script
>
import
Atom
from
"./atom"
;
import
Project
from
"./project"
;
export
default
{
// name: 'sysproject',
data
()
{
return
{};
},
components
:{
Project
,
Atom
}
};
</
script
>
<
style
lang=
"less"
scoped
>
#sysproject{
display: flex;
}
.tree_left {
width: 300px;
height: 100%;
}
.count_right {
width: calc(100% - 300px);
}
</
style
>
\ No newline at end of file
pages/system/project/project/add.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project.status"
v-model=
"entity.status"
type=
'radio'
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
name
:
""
,
upId
:
this
.
eid
,
level
:
null
,
tenantId
:
null
,
type
:
null
,
englishFullName
:
""
,
englishName
:
""
,
status
:
null
,
description
:
""
,
inheritCategoryId
:
null
,
code
:
""
,
module
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
v
:
Object
,
eid
:
Number
,
typeValue
:
Number
},
mounted
()
{
this
.
entity
.
type
=
this
.
typeValue
;
// if (this.eid > 0) {
// this.load(this.eid);
// }
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
eid
(
v
)
{
// if (v > 0) {
// this.load(v);
// }
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/project/api.js
deleted
100644 → 0
View file @
736da3b1
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
systemUrl
}
/project/paged`
,
treepaged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/list`
,
params
);
},
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/paged`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/project/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/create`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
systemUrl
}
/project/delete`
,
{
params
:
{
id
:
id
}
});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/batchdelete`
,
params
);
}
}
\ No newline at end of file
pages/system/project/project/detail.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div
class=
"detail"
>
<Row>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
><state
code=
"base.project.type"
:value=
"entity.type"
/></Filed>
<Filed
:span=
"12"
:name=
"l('englishFullName')"
>
{{
entity
.
englishFullName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishName')"
>
{{
entity
.
englishName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('status')"
><state
code=
"base.project.status"
:value=
"entity.status"
/></Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('module')"
>
{{
entity
.
module
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('description')"
>
{{
entity
.
description
}}
</Filed>
</Row>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/project/edit.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
let
datas
=
{
creationTime
:
this
.
entity
.
creationTime
,
creatorUserId
:
this
.
entity
.
creatorUserId
,
description
:
this
.
entity
.
description
,
code
:
this
.
entity
.
code
,
id
:
this
.
entity
.
id
,
englishFullName
:
this
.
entity
.
englishFullName
,
englishName
:
this
.
entity
.
englishName
,
inheritCategoryId
:
this
.
entity
.
inheritCategoryId
,
lastModificationTime
:
this
.
entity
.
lastModificationTime
,
lastModifierUserId
:
this
.
entity
.
lastModifierUserId
,
level
:
this
.
entity
.
level
,
module
:
this
.
entity
.
module
,
name
:
this
.
entity
.
name
,
status
:
this
.
entity
.
status
,
tenantId
:
this
.
entity
.
tenantId
,
type
:
this
.
entity
.
type
,
upId
:
this
.
entity
.
upId
,
};
Api
.
update
(
datas
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/project/index.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<div
style=
"padding-top: 10px"
>
<TreeGrid
:columns=
"columns"
:items=
"treeData"
ref=
"grid"
>
<template
slot=
"easySearch"
><Form
ref=
"formInline"
:model=
"easySearch"
inline
><FormItem
prop=
"keys"
><Input
placeholder=
"请输入关键字分类名称/英文全称/英文简称/编码"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem
>
</Form></
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add()"
>
新增
</Button>
</
template
>
</TreeGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
>
<component
:is=
"detail"
:typeValue=
"typeValue"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
"项目"
,
author
:
"henq"
,
description
:
"project 10/14/2020 10:22:51 AM"
,
},
data
()
{
return
{
treeList
:
[],
treeData
:
[],
// action: Api.index,
easySearch
:
{
keys
:
{
op
:
"name,englishFullName,englishName,code"
,
value
:
null
},
},
typeValue
:
0
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
columns
:
[
{
key
:
"name"
,
title
:
this
.
l
(
"name"
),
align
:
"left"
,
hide
:
true
,
easy
:
true
,
high
:
true
,
tree
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project.type"
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project.status"
,
},
{
key
:
"englishFullName"
,
title
:
this
.
l
(
"englishFullName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"englishName"
,
title
:
this
.
l
(
"englishName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"module"
,
title
:
this
.
l
(
"module"
),
align
:
"left"
,
high
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
160
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
.
id
)
},
},
"查看"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"add"
},
on
:
{
click
:
()
=>
this
.
rowadd
(
params
.
row
.
id
)
},
},
"新增"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
},
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
},
},
"删除"
),
]);
},
},
],
};
},
mounted
()
{
this
.
init
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
init
()
{
let
data
=
{
conditions
:
[],
};
Api
.
treepaged
(
data
).
then
((
r
)
=>
{
this
.
treeData
=
[];
this
.
treeData
=
r
.
result
;
this
.
treeList
=
r
.
result
;
this
.
treeData
=
this
.
$u
.
toTree
(
r
.
result
,
0
,
(
u
)
=>
{
u
.
label
=
u
.
name
;
},
"upId"
);
});
},
ok
()
{
this
.
init
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
// console.log(this.easySearch);
// console.log(this.$refs.grid);
this
.
init
();
// this.$refs.grid.reload(this.easySearch);
},
add
()
{
this
.
typeValue
=
0
;
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
rowadd
(
id
)
{
this
.
typeValue
=
1
;
this
.
curId
=
id
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
var
len
=
this
.
treeList
.
filter
(
u
=>
{
return
u
.
upId
==
id
}).
length
;
if
(
len
>
0
){
this
.
$Message
.
warning
(
"包含子对象,不能删除!"
)
return
;
}
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
init
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
l
(
key
)
{
/*
project:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
}
*/
let
vkey
=
"project"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
<
style
lang=
"less"
></
style
>
pages/system/project/project/search.vue
deleted
100644 → 0
View file @
736da3b1
<
template
>
<Form
ref=
"form"
:model=
"condition"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
:v-if=
"condition.id.show"
><FormItem
:label=
"$t('id')"
prop=
"id"
>
<Input
v-model=
"condition.id.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creationTime.show"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.creationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creatorUserId.show"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<Input
v-model=
"condition.creatorUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModificationTime.show"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.lastModificationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModifierUserId.show"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<Input
v-model=
"condition.lastModifierUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.deletionTime.show"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.deletionTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.name.show"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"condition.name.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.upId.show"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<Input
v-model=
"condition.upId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.level.show"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"condition.level.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.tenantId.show"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<Input
v-model=
"condition.tenantId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.type.show"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Input
v-model=
"condition.type.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishFullName.show"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"condition.englishFullName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishName.show"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"condition.englishName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.status.show"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"condition.status.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
:v-if=
"condition.description.show"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"condition.description.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.inheritCategoryId.show"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<Input
v-model=
"condition.inheritCategoryId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.code.show"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"condition.code.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.module.show"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"condition.module.value"
>
</Input>
</FormItem
></Col>
</Row>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
condition
:
{
id
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
creationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
creatorUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
lastModificationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
lastModifierUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
deletionTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
name
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
upId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
level
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
tenantId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
type
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishFullName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
status
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
description
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
inheritCategoryId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
code
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
module
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
},
};
},
methods
:
{
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
};
</
script
>
\ No newline at end of file
pages/test/Message/add.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('state')"
prop=
"state"
>
<Dictionary
code=
"system.method.level"
v-model=
"entity.state"
></Dictionary>
</FormItem></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('state')"
prop=
"state"
>
<Dictionary
code=
"system.method.level"
v-model=
"entity.state"
></Dictionary>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Add'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
v
:
Object
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"Message"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
}
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
v
:
Object
,
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
</
script
>
\ No newline at end of file
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"Message"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
},
};
</
script
>
\ No newline at end of file
pages/test/Message/edit.vue
View file @
1980d95c
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('state')"
prop=
"state"
>
<Dictionary
code=
"system.method.level"
v-model=
"entity.state"
></Dictionary>
</FormItem></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('title')"
prop=
"title"
>
<Input
v-model=
"entity.title"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('state')"
prop=
"state"
>
<Dictionary
code=
"system.method.level"
v-model=
"entity.state"
></Dictionary>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Edit'
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
eid
:
Number
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
'on-load'
)
})
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
}
})
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
l
(
key
)
{
key
=
"Message"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
}
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"Message"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment