Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-operation-4
Overview
Overview
Details
Activity
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
达摩4.0重构
haoban-operation-4
Commits
0d1869da
Commit
0d1869da
authored
Nov 13, 2020
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加接口
parent
e55390dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
15 deletions
+90
-15
sql.js
src/api/sql.js
+9
-3
edit-account.vue
src/components/account/edit-account.vue
+71
-4
current-account.vue
src/views/account/current-account.vue
+7
-5
history-account.vue
src/views/account/history-account.vue
+3
-3
No files found.
src/api/sql.js
View file @
0d1869da
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-09 11:22:08
* @LastEditors: 无尘
* @LastEditTime: 2020-11-13 1
5:16:13
* @LastEditTime: 2020-11-13 1
7:25:39
*/
import
getFetch
from
'./get-fetch'
;
...
...
@@ -36,14 +36,20 @@ let api = {
useFormData
:
true
,
useIntercept
:
false
},
getAcountList
:
'/'
,
// 获取试用账号列表
setAcountStatus
:
{
getAc
c
ountList
:
'/'
,
// 获取试用账号列表
setAc
c
ountStatus
:
{
url
:
"/"
,
// 结束试用
method
:
"post"
,
useFormData
:
true
,
useIntercept
:
false
},
getEnterpriseList
:
'/'
,
// 获取企业列表数据
saveAccount
:
{
url
:
"/"
,
// 结束试用
method
:
"post"
,
useFormData
:
true
,
useIntercept
:
false
},
};
api
=
getFetch
(
api
,
'/hb-manage-operation-web'
);
...
...
src/components/account/edit-account.vue
View file @
0d1869da
...
...
@@ -4,12 +4,16 @@
* @Author: 无尘
* @Date: 2020-11-13 14:24:53
* @LastEditors: 无尘
* @LastEditTime: 2020-11-13 16:32:30
* @LastEditTime: 2020-11-13 17:25:54
-->
<!--
<edit-account :edit-row="editRow"></edit-account>
import editAccount from '@/components/sql/edit-account.vue';
-->
<
template
>
<el-dialog
:title=
"!!editRow.id ? '编辑账号':'新增账号'"
:visible
.
sync=
"dialogVisible"
width=
"600px"
:before-close=
"handleClose"
>
<div
class=
""
>
<el-form
:model=
"ruleForm"
ref=
"ruleForm"
label-width=
"10px"
class=
"demo-ruleForm"
@
submit
.
native
.
prevent
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"10px"
class=
"demo-ruleForm"
@
submit
.
native
.
prevent
>
<el-form-item
label=
"用户姓名"
prop=
""
>
<el-input
class=
"w-363"
v-model=
"ruleForm.sqlCheckSql"
maxlength=
"500"
show-word-limit
></el-input>
</el-form-item>
...
...
@@ -59,6 +63,10 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
@
click=
"cancelEdit"
>
取消
</el-button>
<el-button
type=
"primary"
:loading=
"loadBtn"
@
click=
"submitForm('ruleForm')"
>
立即创建
</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
...
...
@@ -67,7 +75,7 @@
<
script
>
import
fetch
from
'@/api/dictionary'
;
const
{
getEnterpriseList
}
=
fetch
;
const
{
getEnterpriseList
,
saveAccount
}
=
fetch
;
export
default
{
name
:
'SqlDetail'
,
components
:
{},
...
...
@@ -91,6 +99,23 @@ export default {
sqlCheckIndexType
:
''
,
statusFlag
:
''
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入用户姓名'
,
trigger
:
'blur'
},
],
region
:
[
{
required
:
true
,
message
:
'请输入用户手机号'
,
trigger
:
'blur'
}
],
region
:
[
{
required
:
true
,
message
:
'请输入试用账号'
,
trigger
:
'blur'
}
],
region
:
[
{
required
:
true
,
message
:
'请选择账号类型'
,
trigger
:
'change'
}
],
region
:
[
{
required
:
true
,
message
:
'请选择试用企业'
,
trigger
:
'change'
}
],
},
validOptions
:
[
{
value
:
''
,
...
...
@@ -134,6 +159,7 @@ export default {
},
// methods
methods
:
{
/**
* 输入
*/
...
...
@@ -172,10 +198,51 @@ export default {
*/
handleClose
()
{
const
that
=
this
;
that
.
$emit
(
'close
Detail
'
);
that
.
$emit
(
'close
Edit
'
);
that
.
$refs
[
'ruleForm'
].
resetFields
();
},
cancelEdit
()
{
const
that
=
this
;
that
.
$emit
(
'closeEdit'
);
that
.
$refs
[
'ruleForm'
].
resetFields
();
},
/**
* 确定保存
*/
submitForm
:
_debounce
(
function
(
form
)
{
const
that
=
this
;
that
.
loadBtn
=
true
;
that
.
$refs
[
form
].
validate
(
valid
=>
{
if
(
valid
)
{
that
.
postAdd
();
}
else
{
that
.
loadBtn
=
false
;
return
false
;
}
});
},
300
),
postAdd
()
{
const
that
=
this
;
let
params
=
{
staffId
:
that
.
departObj
.
staffId
,
clerkId
:
that
.
selectId
};
saveAccount
(
params
)
.
then
(
res
=>
{
that
.
loadBtn
=
false
;
if
(
res
.
code
==
'0000'
)
{
showMsg
.
showmsg
(
'添加成功'
,
'success'
);
that
.
$emit
(
'refreshData'
,
that
.
partForm
);
return
false
;
}
else
{
}
})
.
catch
(
function
(
error
)
{
that
.
loadBtn
=
false
;
});
},
},
watch
:
{
editRow
(
newData
)
{
...
...
src/views/account/current-account.vue
View file @
0d1869da
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-13 10:59:31
* @LastEditors: 无尘
* @LastEditTime: 2020-11-13 1
4:18:37
* @LastEditTime: 2020-11-13 1
7:26:13
-->
<
template
>
<div
class=
"common-right"
>
...
...
@@ -47,17 +47,19 @@
<div
class=
"block common-wrap__page text-right m-t-24"
v-if=
"tableData.length != 0"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<edit-account
v-if=
"showEdit"
:edit-row=
"editRow"
></edit-account>
</div>
</template>
<
script
>
import
editAccount
from
'@/components/sql/edit-account.vue'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
fetch
from
'@/api/dictionary'
;
const
{
getAc
ountList
,
setA
countStatus
}
=
fetch
;
const
{
getAc
countList
,
setAc
countStatus
}
=
fetch
;
export
default
{
name
:
'ProjectSql'
,
components
:
{},
components
:
{
editAccount
},
data
()
{
return
{
searchInput
:
''
,
...
...
@@ -132,7 +134,7 @@ export default {
pageNum
:
that
.
currentPage
,
pageSize
:
that
.
pageSize
};
getAcountList
(
param
).
then
(
res
=>
{
getAc
c
ountList
(
param
).
then
(
res
=>
{
that
.
loading
=
false
;
that
.
tableData
=
res
.
result
.
result
||
[];
that
.
total
=
res
.
result
.
totalCount
||
0
;
...
...
@@ -175,7 +177,7 @@ export default {
const
param
=
{
}
setAcountStatus
(
param
).
then
(
res
=>
{
setAc
c
ountStatus
(
param
).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
that
.
$message
({
message
:
'结束试用成功'
,
...
...
src/views/account/history-account.vue
View file @
0d1869da
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-13 10:59:48
* @LastEditors: 无尘
* @LastEditTime: 2020-11-13 1
6:39:54
* @LastEditTime: 2020-11-13 1
7:26:23
-->
<
template
>
<div
class=
"common-right"
>
...
...
@@ -53,7 +53,7 @@
import
{
_debounce
}
from
'@/common/js/public'
;
import
fetch
from
'@/api/dictionary'
;
const
{
getAcountList
}
=
fetch
;
const
{
getAc
c
ountList
}
=
fetch
;
export
default
{
name
:
'ProjectSql'
,
components
:
{},
...
...
@@ -129,7 +129,7 @@ export default {
pageNum
:
that
.
currentPage
,
pageSize
:
that
.
pageSize
};
getAcountList
(
param
).
then
(
res
=>
{
getAc
c
ountList
(
param
).
then
(
res
=>
{
that
.
loading
=
false
;
that
.
tableData
=
res
.
result
.
result
||
[];
that
.
total
=
res
.
result
.
totalCount
||
0
;
...
...
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