Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
horse
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
向伟
horse
Commits
f5908581
Commit
f5908581
authored
Nov 11, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
17b724aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
186 deletions
+121
-186
axios.ts
src/api/axios.ts
+113
-111
customerField.vue
src/pages/customer/components/customerField.vue
+8
-75
No files found.
src/api/axios.ts
View file @
f5908581
...
...
@@ -109,7 +109,9 @@ service.interceptors.response.use(
/** 请求有响应 */
async
(
response
:
AxiosResponse
)
=>
{
if
(
response
.
status
===
200
)
{
if
(
response
.
data
.
Code
===
1
)
{
return
Promise
.
resolve
(
response
)
}
}
else
{
const
__text
=
getErrorCode2text
(
response
)
return
Promise
.
reject
(
new
Error
(
__text
))
...
...
src/pages/customer/components/customerField.vue
View file @
f5908581
...
...
@@ -16,7 +16,7 @@
<tr
v-if=
"data && data.length==0"
>
<td
:colspan=
"8"
align=
"center"
>
暂无数据
</td>
</tr>
<draggable
v-model=
"data"
tag=
"tbody"
item-key=
"Id"
@
update=
"datadragEnd"
>
<draggable
v-model=
"data"
tag=
"tbody"
item-key=
"Id"
@
update=
"datadragEnd"
:clone=
"cloneFun"
>
<template
#
item=
"
{ element }">
<tr>
<td><span>
{{
element
.
Name
}}
</span></td>
...
...
@@ -57,88 +57,21 @@
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onMounted
}
from
'vue'
import
{
defineComponent
,
ref
,
onMounted
}
from
'vue'
import
customerService
from
'@/api/customer'
import
draggable
from
"vuedraggable"
;
export
default
defineComponent
({
components
:
{
draggable
},
setup
()
{
const
data
=
[{
DeptId
:
0
,
DeptName
:
"-"
,
Digits
:
0
,
Enable
:
1
,
Id
:
21
,
InputType
:
"2"
,
IsDefault
:
0
,
IsLock
:
0
,
IsSystem
:
0
,
Name
:
"姓名"
,
Options
:
"[
\
r
\n
{
\
r
\n
\"
Id
\"
: 0,
\
r
\n
\"
Name
\"
:
\"\"
\
r
\n
}
\
r
\n
]"
,
OptionsList
:
[{
Id
:
0
,
Name
:
""
}],
Required
:
1
,
Sort
:
1
,
Type
:
1
,
TypeName
:
"单行文本"
,
UpdateBy
:
1
,
UpdateByName
:
"管理员"
,
UpdateTime
:
"2021-09-28 11:06:00"
,
WordNum
:
11
,
},
{
DeptId
:
0
,
DeptName
:
"-"
,
Digits
:
0
,
Enable
:
1
,
Id
:
15
,
InputType
:
"1"
,
IsDefault
:
0
,
IsLock
:
0
,
IsSystem
:
0
,
Name
:
"性别"
,
Options
:
"[
\
r
\n
{
\
r
\n
\"
Id
\"
: 1,
\
r
\n
\"
Name
\"
:
\"
男
\"
\
r
\n
},
\
r
\n
{
\
r
\n
\"
Id
\"
: 2,
\
r
\n
\"
Name
\"
:
\"
女
\"
\
r
\n
}
\
r
\n
]"
,
OptionsList
:
[{
Id
:
1
,
Name
:
"男"
},
{
Id
:
2
,
Name
:
"女"
}],
Required
:
1
,
Sort
:
5
,
Type
:
3
,
TypeName
:
"单选"
,
UpdateBy
:
1
,
UpdateByName
:
"管理员"
,
UpdateTime
:
"2021-09-28 11:08:19"
,
WordNum
:
1
,
},{
DeptId
:
0
,
DeptName
:
"-"
,
Digits
:
0
,
Enable
:
1
,
Id
:
13
,
InputType
:
"1"
,
IsDefault
:
0
,
IsLock
:
0
,
IsSystem
:
0
,
Name
:
"性别2"
,
Options
:
"[
\
r
\n
{
\
r
\n
\"
Id
\"
: 1,
\
r
\n
\"
Name
\"
:
\"
男
\"
\
r
\n
},
\
r
\n
{
\
r
\n
\"
Id
\"
: 2,
\
r
\n
\"
Name
\"
:
\"
女
\"
\
r
\n
}
\
r
\n
]"
,
OptionsList
:
[{
Id
:
1
,
Name
:
"男"
},
{
Id
:
2
,
Name
:
"女"
}],
Required
:
1
,
Sort
:
5
,
Type
:
3
,
TypeName
:
"单选2"
,
UpdateBy
:
1
,
UpdateByName
:
"管理员2"
,
UpdateTime
:
"2021-09-28 11:08:19"
,
WordNum
:
1
,
}];
const
data
=
ref
([]);
const
changePage
=
()
=>
{
customerService
.
getCustomerFiledList
({
Enable
:
-
1
}).
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
132
,
res
)
data
.
value
=
res
.
data
.
Data
})
}
// const getdata = (e) => {
// console.log(e,'拖动中的元素')
// }
const
datadragEnd
=
()
=>
{
console
.
log
(
'拖动结束'
)
const
datadragEnd
=
(
e
:
any
)
=>
{
console
.
log
(
'拖动结束'
,
e
)
}
onMounted
(()
=>
{
...
...
@@ -148,7 +81,7 @@
return
{
data
,
changePage
,
datadragEnd
datadragEnd
,
}
}
...
...
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