Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
ndr
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
ndr
Commits
c64396ed
提交
c64396ed
authored
3月 28, 2023
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加绑定用户功能
上级
f43addf4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
220 行增加
和
92 行删除
+220
-92
launch.json
.hbuilderx/launch.json
+18
-14
index.html
index.html
+23
-17
index.vue
src/pages/index/index.vue
+155
-45
vite.config.ts
vite.config.ts
+24
-16
没有找到文件。
.hbuilderx/launch.json
浏览文件 @
c64396ed
{
//
launch.json
配置了启动调试时相关设置,configurations下节点名称可为
app-plus/h
5
/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp
-360
/
//
launchtype项可配置值为local或remote
,
local代表前端连本地云函数,remote代表前端连云端云函数
"version"
:
"0.0"
,
"configurations"
:
[{
"default"
:
{
"launchtype"
:
"local"
},
"mp-weixin"
:
{
"launchtype"
:
"local"
},
"type"
:
"uniCloud"
}
{
//
launch.json
配置了启动调试时相关设置,configurations下节点名称可为
app-plus/h
5
/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp
-360
/
//
launchtype项可配置值为local或remote
,
local代表前端连本地云函数,remote代表前端连云端云函数
"version"
:
"0.0"
,
"configurations"
:
[
{
"default"
:
{
"launchtype"
:
"local"
},
"mp-weixin"
:
{
"launchtype"
:
"local"
},
"type"
:
"uniCloud"
},
{
"openVueDevtools"
:
true
,
"type"
:
"uni-app:h5"
}
]
}
index.html
浏览文件 @
c64396ed
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
/>
<script>
var
coverSupport
=
'CSS'
in
window
&&
typeof
CSS
.
supports
===
'function'
&&
(
CSS
.
supports
(
'top: env(a)'
)
||
CSS
.
supports
(
'top: constant(a)'
))
document
.
write
(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'
+
(
coverSupport
?
', viewport-fit=cover'
:
''
)
+
'" />'
)
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div
id=
"app"
>
<!--app-html-->
</div>
<script
type=
"module"
src=
"/src/main.ts"
></script>
</body>
<head>
<meta
charset=
"UTF-8"
/>
<script>
var
coverSupport
=
'CSS'
in
window
&&
typeof
CSS
.
supports
===
'function'
&&
(
CSS
.
supports
(
'top: env(a)'
)
||
CSS
.
supports
(
'top: constant(a)'
))
document
.
write
(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'
+
(
coverSupport
?
', viewport-fit=cover'
:
''
)
+
'" />'
)
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div
id=
"app"
>
<!--app-html-->
</div>
<script
type=
"module"
src=
"/src/main.ts"
></script>
<script
src=
"//res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>
<!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> -->
</body>
</html>
src/pages/index/index.vue
浏览文件 @
c64396ed
...
...
@@ -4,7 +4,15 @@
<view
class=
"header"
>
<text
class=
"title"
>
登记项目工时
</text>
<text
class=
"subtitle"
@
click=
"() => calendarRef?.open()"
>
选择日期
{{
date
}}
</text>
<text
class=
"title-description"
>
*每天工时总数应为8小时;每天最多登记3个项目的工时;最早只能补录单月的工时数据。
</text>
<text
class=
"title-description"
>
*每天工时总数应为8小时;每天最多登记3个项目的工时;最早只能补录单月的工时数据。
</text>
<view
class=
"accout"
>
<view
style=
"width: 80%;"
>
<uni-easyinput
v-model=
"userId"
:disabled=
"disabled"
placeholder=
"员工姓名"
/>
</view>
<button
size=
"mini"
@
tap=
"onBind"
:disabled=
"disabled"
>
绑定
</button>
</view>
</view>
<view
class=
"content"
>
...
...
@@ -25,6 +33,8 @@ import { ref, onMounted } from 'vue'
import
formList
from
'./components/formList.vue'
;
const
date
:
any
=
ref
(
''
)
const
disabled
=
ref
(
false
)
const
userId
=
ref
()
const
placeholderList
:
any
=
ref
([
{
placeholder
:
'项目1'
},
...
...
@@ -143,6 +153,42 @@ const onSubmit = () => {
},
100
);
}
const
onBind
=
()
=>
{
if
(
!
userId
.
value
)
return
uni
.
showToast
({
title
:
'请输入员工姓名'
,
icon
:
'none'
})
let
data
=
{
// ID: 'xh.',
parmeters
:
{
Model
:
{
F_LQKJ_FNANEM
:
{
FName
:
userId
.
value
},
F_LQKJ_ID
:
'xh.'
}
}
}
uni
.
request
({
url
:
'/ndr/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.addUser,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc'
,
data
,
method
:
'POST'
,
success
:
(
res
:
any
)
=>
{
const
{
data
}
=
res
if
(
data
.
code
===
200
)
{
disabled
.
value
=
true
return
uni
.
showToast
({
title
:
'绑定成功'
,
icon
:
'none'
})
}
else
uni
.
showToast
({
title
:
data
.
msg
,
icon
:
'none'
})
},
})
}
const
login
=
()
=>
{
uni
.
showLoading
({
title
:
'加载中...'
,
...
...
@@ -160,21 +206,64 @@ const login = () => {
parameters
:
[
"640aea3709a243"
,
"Administrator"
,
"kingdee$2023"
,
2052
]
},
success
(
res
:
any
)
{
uni
.
hideLoading
()
formListRef
.
value
?.
map
((
item
:
any
)
=>
item
.
initRules
())
// getAccessToken()
handleIsExist
()
}
})
}
const
getAccessToken
=
()
=>
{
uni
.
request
({
url
:
'/ndr/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.RequestToken,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc'
,
method
:
'GET'
,
success
(
res
:
any
)
{
console
.
log
(
res
);
const
{
access_token
}
=
res
.
data
localStorage
.
setItem
(
'token'
,
access_token
)
handleIsExist
()
}
})
}
const
getUserInfo
=
()
=>
{
uni
.
request
({
url
:
'/ndr/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.Request,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc'
,
method
:
'POST'
,
success
(
res
:
any
)
{
console
.
log
(
res
);
// const { access_token } = res
// localStorage.setItem('token', access_token)
}
})
}
const
handleIsExist
=
()
=>
{
uni
.
request
({
url
:
'/ndr/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.selectUser,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc'
,
method
:
'GET'
,
data
:
{
ID
:
'xh.'
},
success
:
(
res
:
any
)
=>
{
uni
.
hideLoading
()
const
{
data
}
=
res
if
(
data
.
code
===
200
)
{
console
.
log
(
data
);
disabled
.
value
=
true
}
else
{
disabled
.
value
=
false
userId
.
value
=
''
}
},
})
}
onMounted
(()
=>
{
login
()
date
.
value
=
newDate
()
// formListRef.value?.map((item: any) => item.initRules())
})
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.queryRecords
{
box-sizing
:
border-box
;
width
:
100%
;
...
...
@@ -185,40 +274,61 @@ onMounted(() => {
.container
{
margin-top
:
50rpx
;
}
.header
{
width
:
100%
;
text-align
:
center
;
}
.header
{
width
:
100%
;
text-align
:
center
;
.title
{
display
:
block
;
font-size
:
32
rpx
;
font-weight
:
bold
;
}
.title
{
display
:
block
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
.subtitle
{
display
:
block
;
font-size
:
28
rpx
;
color
:
rgb
(
100
,
143
,
193
);
margin
:
24
rpx
0
;
}
.subtitle
{
display
:
block
;
font-size
:
28rpx
;
color
:
rgb
(
100
,
143
,
193
);
margin
:
24rpx
0
;
}
.title-description
{
display
:
block
;
font-size
:
24
rpx
;
color
:
#ccc
;
margin
:
24
rpx
0
60
rpx
0
;
padding
:
20
rpx
;
}
.title-description
{
display
:
block
;
font-size
:
24rpx
;
color
:
#ccc
;
margin
:
24rpx
0
60rpx
0
;
padding
:
20rpx
;
}
.content
{
box-sizing
:
border-box
;
width
:
100%
;
padding
:
20
rpx
;
.accout
{
width
:
100%
;
display
:
flex
;
justify-content
:
flex-start
;
align-items
:
center
;
box-sizing
:
border-box
;
line-height
:
12px
;
padding
:
20rpx
;
button
{
width
:
200rpx
;
height
:
100%
;
margin
:
0
;
font-weight
:
bold
;
color
:
#fff
;
background-color
:
rgb
(
7
,
193
,
69
);
margin-left
:
20rpx
;
}
}
}
.content
{
box-sizing
:
border-box
;
width
:
100%
;
padding
:
20rpx
;
}
}
.content-list
{
margin-bottom
:
20rpx
;
}
...
...
@@ -239,21 +349,21 @@ onMounted(() => {
align-items
:
center
;
flex-direction
:
column
;
margin-top
:
50rpx
;
}
.button
button
{
width
:
240
rpx
;
margin-bottom
:
20
rpx
;
font-weight
:
bold
;
}
&
button
{
width
:
240rpx
;
margin-bottom
:
20rpx
;
font-weight
:
bold
;
}
.button
button
:first-child
{
color
:
rgb
(
7
,
193
,
69
);
background-color
:
rgb
(
242
,
242
,
242
);
}
&
button
:first-child
{
color
:
rgb
(
7
,
193
,
69
);
background-color
:
rgb
(
242
,
242
,
242
);
}
.button
button
:last-child
{
color
:
#fff
;
background-color
:
rgb
(
7
,
193
,
69
);
&
button
:last-child
{
color
:
#fff
;
background-color
:
rgb
(
7
,
193
,
69
);
}
}
</
style
>
vite.config.ts
浏览文件 @
c64396ed
import
{
defineConfig
}
from
"vite"
;
import
uni
from
"@dcloudio/vite-plugin-uni"
;
import
{
defineConfig
}
from
'vite'
;
import
uni
from
'@dcloudio/vite-plugin-uni'
;
// https://vitejs.dev/config/
export
default
defineConfig
({
plugins
:
[
uni
()],
server
:
{
host
:
'0.0.0.0'
,
port
:
7879
,
open
:
true
,
strictPort
:
false
,
// 端口被占用直接退出
https
:
false
,
// 默认用http方式
proxy
:
{
'/ndr'
:
{
target
:
'http://192.168.0.90/'
,
},
},
},
plugins
:
[
uni
()],
server
:
{
host
:
'0.0.0.0'
,
port
:
7879
,
open
:
true
,
strictPort
:
false
,
// 端口被占用直接退出
proxy
:
{
'/ndr'
:
{
target
:
'http://192.168.0.90/'
,
},
},
},
build
:
{
minify
:
'terser'
,
terserOptions
:
{
compress
:
{
//生产环境时移除console
drop_console
:
true
,
drop_debugger
:
true
,
},
},
},
});
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论