Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
document-management
Project
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
ry-istanbul-web
document-management
Commits
37fc3239
Commit
37fc3239
authored
Nov 23, 2022
by
lxyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:部分接口调试完成
parent
f9c21c59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
208 additions
and
144 deletions
+208
-144
customer.js
src/api/system/customer.js
+31
-0
index.js
src/router/index.js
+5
-5
index.vue
src/views/system/customer/index.vue
+172
-139
No files found.
src/api/system/customer.js
View file @
37fc3239
...
...
@@ -37,3 +37,33 @@ export function doctaskList(data) {
params
:
data
})
}
// 提交表单
export
function
doctaskUpsert
(
data
)
{
return
request
({
url
:
'/api/doc/doctask/upsert'
,
method
:
'post'
,
data
})
}
// 选择文档
export
function
doctaskDocuments
()
{
return
request
({
url
:
'/api/doc/doctask/documents'
,
method
:
'get'
})
}
// 订阅文档
export
function
doctaskSubscription
({
id
,
sub
})
{
return
request
({
url
:
'/api/doc/doctask/subscription/'
+
id
+
'?sub='
+
sub
,
method
:
'get'
})
}
// 删除文档
export
function
doctaskDelete
(
id
)
{
return
request
({
url
:
'/api/doc/doctask/delete/'
+
id
,
method
:
'get'
})
}
\ No newline at end of file
src/router/index.js
View file @
37fc3239
...
...
@@ -74,7 +74,7 @@ export const constantRoutes = [
children
:
[
{
path
:
'index'
,
component
:
()
=>
import
(
'
..
/views/index'
),
component
:
()
=>
import
(
'
@
/views/index'
),
name
:
'搜索文档'
,
meta
:
{
title
:
'搜索文档'
,
icon
:
'search-new'
,
noCache
:
true
,
affix
:
true
}
}
...
...
@@ -103,7 +103,7 @@ export const constantRoutes = [
children
:
[
{
path
:
'type/data/:dictId(
\\
d+)'
,
component
:
()
=>
import
(
'
..
/views/system/dict/data'
),
component
:
()
=>
import
(
'
@
/views/system/dict/data'
),
name
:
'字典数据'
,
meta
:
{
title
:
'字典数据'
,
icon
:
''
}
}
...
...
@@ -119,7 +119,7 @@ export const constantRoutes = [
path
:
'/documentManagement'
,
children
:
[
{
component
:
()
=>
import
(
'
..
/views/dataList/dashboard/index'
),
component
:
()
=>
import
(
'
@
/views/dataList/dashboard/index'
),
meta
:
{
icon
:
''
,
title
:
'搜索文档详情'
...
...
@@ -129,7 +129,7 @@ export const constantRoutes = [
hidden
:
true
},
{
component
:
()
=>
import
(
'
..
/views/system/customer/index'
),
component
:
()
=>
import
(
'
@
/views/system/customer/index'
),
meta
:
{
icon
:
''
,
title
:
'跟踪文档'
...
...
@@ -141,7 +141,7 @@ export const constantRoutes = [
}
},
{
component
:
()
=>
import
(
'
..
/views/dataList/product/index'
),
component
:
()
=>
import
(
'
@
/views/dataList/product/index'
),
meta
:
{
icon
:
''
,
title
:
'跟踪文档详情'
...
...
src/views/system/customer/index.vue
View file @
37fc3239
...
...
@@ -30,9 +30,9 @@
<el-table-column
label=
"订阅状态"
fixed=
"left"
width=
"90"
align=
"subscription
Status
"
>
align=
"subscription"
>
<template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.subscription
Status
"
<el-switch
v-model=
"scope.row.subscription"
active-value=
"0"
inactive-value=
"1"
@
change=
"handleStatusChange(scope.row)"
></el-switch>
...
...
@@ -41,11 +41,11 @@
<el-table-column
fixed=
"left"
min-width=
"240"
label=
"任务名称"
prop=
"
taskN
ame"
prop=
"
n
ame"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<div
class=
"ellipsis-hidden"
><span
class=
"blue"
@
click=
"routerTaskListDetails(scope.row)"
>
{{
isEmpty
(
scope
.
row
,
'
taskN
ame'
)
}}
</span></div>
<div
class=
"ellipsis-hidden"
><span
class=
"blue"
@
click=
"routerTaskListDetails(scope.row)"
>
{{
isEmpty
(
scope
.
row
,
'
n
ame'
)
}}
</span></div>
</
template
>
</el-table-column>
<el-table-column
min-width=
"160"
...
...
@@ -59,11 +59,11 @@
</el-table-column>
<el-table-column
label=
"任务说明"
min-width=
"280"
prop=
"
explain
"
prop=
"
docDesc
"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<div
class=
"ellipsis-hidden"
>
{{
isEmpty
(
scope
.
row
,
'
explain
'
)
}}
</div>
<div
class=
"ellipsis-hidden"
>
{{
isEmpty
(
scope
.
row
,
'
docDesc
'
)
}}
</div>
</
template
>
</el-table-column>
...
...
@@ -71,7 +71,7 @@
prop=
"createTime"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<span>
{{
isEmpty
(
scope
.
row
,
'createTime'
)
}}
</span>
<span>
{{
dateFilter
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -115,14 +115,14 @@
:model=
"form"
:rules=
"rules"
>
<el-form-item
label=
"任务名称"
prop=
"
taskN
ame"
>
<el-input
v-model
.
trim=
"form.
taskN
ame"
prop=
"
n
ame"
>
<el-input
v-model
.
trim=
"form.
n
ame"
placeholder=
"请输入任务名称"
:disabled=
"editFlag"
/>
</el-form-item>
<el-form-item
label=
"选择文档"
prop=
"doc
ument
"
>
<el-select
v-model=
"form.doc
ument
"
prop=
"doc
DocumentId
"
>
<el-select
v-model=
"form.doc
DocumentId
"
clearable
placeholder=
"请选择文档"
>
<el-option
v-for=
"item in documentOptions"
...
...
@@ -132,19 +132,19 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
class=
"second-level"
v-if=
"form.doc
ument === '1'
"
label=
"文档链接"
<el-form-item
class=
"second-level"
v-if=
"form.doc
DocumentId === 10000
"
label=
"文档链接"
prop=
"link"
>
<el-input
v-model
.
trim=
"form.link"
placeholder=
"请输入文档链接"
/>
</el-form-item>
<el-form-item
label=
"邮箱通知"
prop=
"email"
>
<el-input
v-model
.
trim=
"form.email"
prop=
"email
s
"
>
<el-input
v-model
.
trim=
"form.email
s
"
placeholder=
"请输入要订阅和通知的邮箱"
:disabled=
"editFlag"
/>
</el-form-item>
<el-form-item
label=
"任务说明"
>
<el-input
v-model
.
trim=
"form.
explain
"
<el-input
v-model
.
trim=
"form.
docDesc
"
type=
"textarea"
placeholder=
"请输入任务说明"
/>
</el-form-item>
...
...
@@ -175,7 +175,14 @@
<
script
>
import
{
doctaskList
,
doctaskUpsert
,
doctaskDocuments
,
doctaskSubscription
,
doctaskDelete
}
from
"@/api/system/customer"
;
import
{
deepClone
}
from
"@/utils/index"
;
export
default
{
data
()
{
return
{
...
...
@@ -214,23 +221,14 @@ export default {
// 表单参数
form
:
{
id
:
undefined
,
taskN
ame
:
""
,
doc
ument
:
""
,
n
ame
:
""
,
doc
DocumentId
:
""
,
link
:
""
,
email
:
""
,
explain
:
""
email
s
:
""
,
docDesc
:
""
},
// 选择文档
documentOptions
:
[
{
label
:
"巨量"
,
value
:
"0"
},
{
label
:
"其他"
,
value
:
"1"
}
],
documentOptions
:
[],
editFlag
:
false
,
defaultProps
:
{
children
:
"children"
,
...
...
@@ -238,10 +236,10 @@ export default {
},
// 表单校验
rules
:
{
taskN
ame
:
[
n
ame
:
[
{
required
:
true
,
message
:
"任务名称不能为空"
,
trigger
:
"blur"
}
],
email
:
[
email
s
:
[
{
required
:
true
,
message
:
"邮箱不能为空"
,
trigger
:
"blur"
},
{
validator
:
function
(
rule
,
value
,
callback
)
{
...
...
@@ -255,7 +253,7 @@ export default {
trigger
:
'blur'
}
],
doc
ument
:
[
doc
DocumentId
:
[
{
required
:
true
,
message
:
"请选择文档"
,
trigger
:
"blur"
}
],
link
:
[
...
...
@@ -290,6 +288,24 @@ export default {
}
},
methods
:
{
dateFilter
(
time
)
{
if
(
!
time
)
{
// 当时间是null或者无效格式时我们返回空
return
'-'
}
else
{
const
date
=
new
Date
(
time
)
// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
const
dateNumFun
=
(
num
)
=>
num
<
10
?
`0
${
num
}
`
:
num
// 使用箭头函数和三目运算以及es6字符串的简单操作。因为只有一个操作不需要{} ,目的就是数字小于10,例如9那么就加上一个0,变成09,否则就返回本身。 // 这是es6的解构赋值。
const
[
Y
,
M
,
D
,
h
,
m
,
s
]
=
[
date
.
getFullYear
(),
dateNumFun
(
date
.
getMonth
()
+
1
),
dateNumFun
(
date
.
getDate
()),
dateNumFun
(
date
.
getHours
()),
dateNumFun
(
date
.
getMinutes
()),
dateNumFun
(
date
.
getSeconds
())
]
return
`
${
Y
}
-
${
M
}
-
${
D
}
${
h
}
:
${
m
}
:
${
s
}
`
// 一定要注意是反引号,否则无效。
}
},
tableHeight
()
{
let
height
=
document
.
documentElement
.
clientHeight
-
128
this
.
tableHeights
=
height
<
580
?
580
:
height
...
...
@@ -300,7 +316,7 @@ export default {
path
:
'/documentManagement/taskListDetails'
,
query
:
{
id
:
row
.
id
,
name
:
row
.
taskN
ame
name
:
row
.
n
ame
}
})
},
...
...
@@ -311,81 +327,62 @@ export default {
// table显示状态
statusTable
(
row
)
{
let
status
=
{
0
:
{
'-1'
:
{
text
:
"暂停中"
,
class
:
"span-table span-gray"
},
'0'
:
{
text
:
"已失效"
,
class
:
"span-table span-red"
},
1
:
{
'1'
:
{
text
:
"运行中"
,
class
:
"span-table span-blue"
},
2
:
{
'2'
:
{
text
:
"已完成"
,
class
:
"span-table span-green"
}
}
return
status
[
row
.
status
]
?
status
[
row
.
status
]
:
{
return
status
[
row
.
status
.
toString
()]
?
status
[
row
.
status
.
toString
()
]
:
{
text
:
""
,
class
:
""
}
},
handleStatusChange
(
row
)
{
// editStatus(row.id, row.subscriptionStatus)
// .then(() => {
this
.
searchCustomer
();
this
.
msgSuccess
(
"修改状态成功"
);
// })
// .catch(() => this.msgError("修改状态失败"));
let
isTrue
=
row
.
subscription
===
'0'
?
true
:
false
doctaskSubscription
({
id
:
row
.
id
,
sub
:
isTrue
})
.
then
((
response
)
=>
{
if
(
response
.
code
===
200
)
{
this
.
searchCustomer
();
this
.
msgSuccess
(
"修改状态成功"
);
}
})
.
catch
(()
=>
this
.
msgError
(
"修改状态失败"
));
},
searchCustomer
()
{
this
.
loading
=
true
;
this
.
customerList
=
[]
doctaskList
(
this
.
queryParams
)
.
then
(
response
=>
{
console
.
log
(
response
,
'response'
)
let
data
=
[
{
id
:
1
,
taskName
:
'任务1'
,
explain
:
'这是一个任务1'
,
subscriptionStatus
:
'1'
,
createTime
:
'2020-10-22 20:16:01'
,
status
:
0
,
document
:
'1'
,
link
:
'https://element.eleme.io/#/zh-CN/component/form#form-item-methods'
,
email
:
'111111111@.qq.com'
},
{
id
:
2
,
taskName
:
'任务2'
,
subscriptionStatus
:
'1'
,
explain
:
'这是一个任务2'
,
createTime
:
'2020-10-22 20:16:01'
,
status
:
1
,
document
:
'0'
,
link
:
''
,
email
:
'111111111@qq.com'
},
{
id
:
3
,
taskName
:
'任务3'
,
explain
:
''
,
subscriptionStatus
:
'0'
,
createTime
:
'2020-10-22 20:16:01'
,
status
:
2
,
document
:
'0'
,
link
:
''
,
email
:
'111111111@.qq.com'
if
(
response
.
code
===
200
)
{
let
content
=
response
.
content
if
(
this
.
total
!==
content
.
totalSize
)
{
this
.
total
=
content
.
totalSize
}
]
// this.customerList = response.data.records;
this
.
customerList
=
data
// data
// this.total = response.data.total;
this
.
total
=
0
;
// 10;
setTimeout
(()
=>
{
this
.
loading
=
false
;
},
2000
)
let
values
=
content
.
value
values
.
forEach
(
item
=>
{
if
(
item
.
subscription
)
{
item
.
subscription
=
'0'
}
else
{
item
.
subscription
=
'1'
}
});
this
.
$set
(
this
,
'customerList'
,
values
)
}
else
{
this
.
customerList
=
[]
}
this
.
loading
=
false
;
this
.
$nextTick
(()
=>
{
this
.
customerListHeights
=
this
.
$refs
.
customerListHeight
.
offsetHeight
})
...
...
@@ -411,11 +408,11 @@ export default {
reset
()
{
this
.
form
=
{
id
:
undefined
,
taskN
ame
:
""
,
doc
ument
:
""
,
n
ame
:
""
,
doc
DocumentId
:
""
,
link
:
""
,
email
:
""
,
explain
:
""
email
s
:
""
,
docDesc
:
""
};
this
.
resetForm
(
"form"
);
},
...
...
@@ -429,13 +426,38 @@ export default {
this
.
queryParams
=
{
current
:
1
,
size
:
10
,
taskN
ame
:
""
n
ame
:
""
};
this
.
searchCustomer
();
},
addDoctaskDocuments
()
{
this
.
documentOptions
=
[]
doctaskDocuments
()
.
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
documentOptions
=
response
.
content
.
map
(
item
=>
{
return
{
'label'
:
item
.
name
,
'value'
:
item
.
id
}
})
}
this
.
documentOptions
.
push
({
label
:
"其他"
,
value
:
10000
})
})
.
catch
(()
=>
{
this
.
documentOptions
.
push
({
label
:
"其他"
,
value
:
10000
})
});
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
addDoctaskDocuments
();
this
.
open
=
true
;
// this.editFlag = false;
this
.
title
=
"创建跟踪任务"
;
...
...
@@ -443,61 +465,64 @@ export default {
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
// getCustomer(row.id).then(response => {
// this.form = response.data;
this
.
handleUpdateFrom
(
row
)
this
.
open
=
true
;
this
.
title
=
"修改跟踪任务"
;
// });
this
.
addDoctaskDocuments
();
this
.
handleUpdateFrom
(
row
)
this
.
open
=
true
;
this
.
title
=
"修改跟踪任务"
;
},
// 修改from赋值
handleUpdateFrom
(
row
)
{
this
.
form
.
id
=
row
.
id
?
row
.
id
:
undefined
this
.
form
.
taskName
=
row
.
taskName
?
row
.
taskN
ame
:
""
this
.
form
.
doc
ument
=
row
.
document
?
row
.
document
:
""
this
.
form
.
name
=
row
.
name
?
row
.
n
ame
:
""
this
.
form
.
doc
DocumentId
=
row
.
docDocumentId
?
row
.
docDocumentId
:
""
this
.
form
.
link
=
row
.
link
?
row
.
link
:
""
this
.
form
.
email
=
row
.
email
?
row
.
email
:
""
this
.
form
.
explain
=
row
.
explain
?
row
.
explain
:
""
this
.
form
.
email
s
=
row
.
emails
?
row
.
emails
:
""
this
.
form
.
docDesc
=
row
.
docDesc
?
row
.
docDesc
:
""
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
)
{
let
form
=
deepClone
(
this
.
form
)
let
fromNew
=
{
name
:
form
.
name
,
docDocumentId
:
Number
(
form
.
docDocumentId
),
emails
:
form
.
emails
,
docDesc
:
form
.
docDesc
}
if
(
form
.
id
)
{
this
.
submitLoading
=
true
;
// editCustomer(this.form)
// .then(response => {
// if (response.code === 200) {
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
searchCustomer
();
// } else {
// this.msgError(response.msg);
// }
// // this.editFlag = false;
// this.submitLoading = false;
// })
// .catch(() => {
// this.submitLoading = false;
// });
fromNew
.
id
=
form
.
id
let
doctaskUpserts
=
doctaskUpsert
(
fromNew
)
Promise
.
all
([
doctaskUpserts
]).
then
((
result
)
=>
{
if
(
result
[
0
].
code
===
200
)
{
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
queryParams
.
pageindex
=
1
this
.
searchCustomer
();
}
this
.
submitLoading
=
false
;
}).
catch
((
error
)
=>
{
this
.
msgError
(
error
);
this
.
submitLoading
=
false
;
})
}
// 否则新建
else
{
this
.
submitLoading
=
true
;
// addCustomer(this.form)
// .then(response => {
// if (response.code === 200) {
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
searchCustomer
();
// } else {
// this.msgError(response.msg);
// }
// this.submitLoading = false;
// })
// .catch(() => {
// this.submitLoading = false;
// });
let
doctaskUpserts
=
doctaskUpsert
(
fromNew
)
Promise
.
all
([
doctaskUpserts
]).
then
((
result
)
=>
{
if
(
result
[
0
].
code
===
200
)
{
this
.
msgSuccess
(
"新建成功"
);
this
.
open
=
false
;
this
.
queryParams
.
pageindex
=
1
this
.
searchCustomer
();
}
this
.
submitLoading
=
false
;
}).
catch
((
error
)
=>
{
this
.
msgError
(
error
);
this
.
submitLoading
=
false
;
})
}
}
});
...
...
@@ -505,7 +530,7 @@ export default {
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'是否确认删除名称为"'
+
row
.
taskN
ame
+
'"的跟踪任务?'
,
'是否确认删除名称为"'
+
row
.
n
ame
+
'"的跟踪任务?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
...
...
@@ -514,13 +539,16 @@ export default {
}
)
.
then
(()
=>
{
// return deleteCustomer(row.id);
})
.
then
(()
=>
{
this
.
searchCustomer
();
this
.
msgSuccess
(
"删除成功"
);
doctaskDelete
(
row
.
id
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"删除成功"
);
this
.
queryParams
.
pageindex
=
1
this
.
searchCustomer
();
}
})
.
catch
((
error
)
=>
this
.
msgError
(
error
))
})
.
catch
((
)
=>
this
.
msgError
(
"删除失败"
));
.
catch
((
error
)
=>
this
.
msgError
(
error
));
}
}
};
...
...
@@ -571,6 +599,11 @@ export default {
background
:
rgba
(
227
,
77
,
89
,
1
);
}
}
.span-gray
{
&
:
:
before
{
background
:
rgb
(
139
,
139
,
139
);
}
}
.span-blue
{
&
:
:
before
{
background
:
rgba
(
0
,
82
,
217
,
1
);
...
...
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