Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zhongtai-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
chenweiping
zhongtai-ui
Commits
c6331cf2
提交
c6331cf2
authored
9月 07, 2021
作者:
林国禄
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
统计点管理
上级
8c2283dd
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
248 行增加
和
53 行删除
+248
-53
point.js
src/api/backstage/point.js
+10
-0
index.vue
src/views/backstage/point/index.vue
+238
-53
没有找到文件。
src/api/backstage/point.js
浏览文件 @
c6331cf2
import
request
from
'@/utils/request'
// 查询统计点列表(级联列表)
export
function
listByProvince
(
query
)
{
return
request
({
url
:
'/backstage/point/listByProvince'
,
method
:
'get'
,
params
:
query
})
}
// 查询统计点列表(级联列表)
export
function
cascadeList
(
type
)
{
return
request
({
...
...
src/views/backstage/point/index.vue
浏览文件 @
c6331cf2
...
...
@@ -113,37 +113,75 @@
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"pointList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
:index=
"table_index"
label=
"序号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"账号"
align=
"center"
prop=
"account"
/>
<el-table-column
label=
"密码"
align=
"center"
prop=
"password"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"经度"
align=
"center"
prop=
"longitude"
/>
<el-table-column
label=
"纬度"
align=
"center"
prop=
"latitude"
/>
<el-table-column
label=
"上级id"
align=
"center"
prop=
"superiorId"
/>
<el-table-column
label=
"统计点类型"
align=
"center"
prop=
"type"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['backstage:point:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['backstage:point:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
<el-table
:data=
"pointList"
style=
"width: 100%"
row-key=
"id"
border
lazy
:load=
"load"
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"index"
:index=
"table_index"
label=
"序号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"账号"
align=
"center"
prop=
"account"
/>
<el-table-column
label=
"密码"
align=
"center"
prop=
"password"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"经度"
align=
"center"
prop=
"longitude"
/>
<el-table-column
label=
"纬度"
align=
"center"
prop=
"latitude"
/>
<el-table-column
label=
"上级id"
align=
"center"
prop=
"superiorId"
/>
<el-table-column
label=
"统计点类型"
align=
"center"
prop=
"type"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['backstage:point:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['backstage:point:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- <el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange">-->
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column type="index" :index="table_index" label="序号" align="center" prop="id"/>-->
<!-- <el-table-column label="名称" align="center" prop="name" />-->
<!-- <el-table-column label="账号" align="center" prop="account" />-->
<!-- <el-table-column label="密码" align="center" prop="password" />-->
<!-- <el-table-column label="状态" align="center" prop="status" />-->
<!-- <el-table-column label="经度" align="center" prop="longitude" />-->
<!-- <el-table-column label="纬度" align="center" prop="latitude" />-->
<!-- <el-table-column label="上级id" align="center" prop="superiorId" />-->
<!-- <el-table-column label="统计点类型" align="center" prop="type" />-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['backstage:point:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['backstage:point:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<pagination
v-show=
"total>0"
:total=
"total"
...
...
@@ -158,19 +196,30 @@
<el-form-item
label=
"名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入名称"
/>
</el-form-item>
<el-form-item
label=
"账号"
prop=
"account"
>
<el-input
v-model=
"form.account"
placeholder=
"请输入账号"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
placeholder=
"请输入密码"
v-model=
"form.password"
show-password
></el-input>
</el-form-item>
<div
v-if=
"this.statisticsPointsType != '6'"
>
<el-form-item
label=
"账号"
prop=
"account"
>
<el-input
v-model=
"form.account"
placeholder=
"请输入账号"
/>
</el-form-item>
<el-form-item
label=
"登录密码"
prop=
"password"
>
<el-input
show-password
type=
"password"
v-model=
"form.password"
autocomplete=
"off"
placeholder=
"密码要求:8-20位字符在数字、小写、大写字母以及特殊字符中四选三"
></el-input>
<el-progress
:percentage=
"passwordPercent"
:format=
"passwordPercentFormat"
></el-progress>
</el-form-item>
<el-form-item
label=
"再次输入密码"
prop=
"comfirmPassword"
>
<el-input
show-password
type=
"password"
v-model=
"form.comfirmPassword"
autocomplete=
"off"
></el-input>
</el-form-item>
<!-- <el-form-item label="密码" prop="password">-->
<!-- <el-input placeholder="请输入密码" type="password" v-model="form.password" show-password></el-input>-->
<!-- </el-form-item>-->
</div>
<el-form-item
v-if=
"this.statisticsPointsType != '1'"
label=
"所属层级"
prop=
"
password
"
>
<el-form-item
v-if=
"this.statisticsPointsType != '1'"
label=
"所属层级"
prop=
"
levelValue
"
>
<div
class=
"block"
>
<span
class=
"demonstration"
></span>
<el-cascader
style=
"width: 100%"
v-model=
"levelValue"
v-model=
"
form.
levelValue"
:options=
"levelOptions"
:props=
"{ expandTrigger: 'hover' }"
@
change=
"handleChange"
...
...
@@ -203,14 +252,72 @@
</template>
<
script
>
import
{
cascadeList
,
listPoint
,
getPoint
,
delPoint
,
addPoint
,
updatePoint
,
exportPoint
}
from
"@/api/backstage/point"
;
import
{
listByProvince
,
cascadeList
,
listPoint
,
getPoint
,
delPoint
,
addPoint
,
updatePoint
,
exportPoint
}
from
"@/api/backstage/point"
;
export
default
{
name
:
"Point"
,
data
()
{
const
validatePassword
=
(
rule
,
value
,
callback
)
=>
{
console
.
log
(
value
)
if
(
value
===
''
||
value
===
undefined
||
value
===
null
)
{
if
(
this
.
form
.
id
==
null
){
callback
(
new
Error
(
'如需新增统计点的相关信息,请输入统计点的密码后才能进行操作'
));
}
else
{
callback
(
new
Error
(
'如需修改统计点的相关信息,请输入统计点的密码后才能进行编辑修改'
));
}
}
else
{
//6-20位包含字符、数字和特殊字符
var
ls
=
0
;
if
(
this
.
form
.
password
!==
''
)
{
if
(
this
.
form
.
password
.
match
(
/
([
a-z
])
+/
)){
ls
++
;
}
if
(
this
.
form
.
password
.
match
(
/
([
0-9
])
+/
)){
ls
++
;
}
if
(
this
.
form
.
password
.
match
(
/
([
A-Z
])
+/
)){
ls
++
;
}
if
(
this
.
form
.
password
.
match
(
/
([\W])
+/
)
&&
!
this
.
form
.
password
.
match
(
/
(
!
[\u
4E00-
\u
9FA5
])
+/
)){
ls
++
;
}
if
(
this
.
form
.
password
.
length
<
6
||
this
.
form
.
password
.
length
>
20
){
callback
(
new
Error
(
'要求6-20位字符'
));
ls
=
0
;
}
if
(
this
.
form
.
password
.
match
(
/
([\u
4E00-
\u
9FA5
])
+/
)){
callback
(
new
Error
(
'不能包含中文字符'
));
ls
=
0
;
}
switch
(
ls
)
{
case
0
:
this
.
passwordPercent
=
0
;
callback
(
new
Error
(
'数字、小写字母、大写字母以及特殊字符中四选三'
));
break
;
case
1
:
this
.
passwordPercent
=
33
;
callback
(
new
Error
(
'数字、小写字母、大写字母以及特殊字符中四选三'
));
break
;
case
2
:
this
.
passwordPercent
=
66
;
callback
(
new
Error
(
'数字、小写字母 、大写字母以及特殊字符中四选三'
));
break
;
case
3
:
case
4
:
this
.
passwordPercent
=
100
;
break
;
default
:
this
.
passwordPercent
=
0
;
break
;
}
}
callback
();
}
};
const
validateConfirmPassword
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
||
value
===
null
)
{
callback
(
new
Error
(
'请输入密码'
));
}
else
{
if
(
this
.
form
.
comfirmPassword
!==
this
.
form
.
password
)
{
callback
(
new
Error
(
'两次输入的密码不一致'
));
// this.$refs.ruleForm.validateField('checkPass');
}
callback
();
}
};
return
{
//密码进度条
passwordPercent
:
0
,
//级联选择器相关
levelValue
:
[],
//
levelValue: [],
levelOptions
:
[],
//统计点类型对象
statisticsPointsTypeObj
:
[
...
...
@@ -259,9 +366,35 @@ export default {
type
:
null
,
},
// 表单参数
form
:
{},
form
:
{
name
:
null
,
account
:
null
,
password
:
null
,
status
:
null
,
longitude
:
null
,
latitude
:
null
,
superiorId
:
null
,
type
:
null
,
comfirmPassword
:
null
,
levelValue
:
null
,
},
// 表单校验
rules
:
{
name
:
[
{
required
:
true
,
message
:
"统计点名称不能为空,请输入统计点名称"
,
trigger
:
"blur"
}
],
account
:
[
{
required
:
true
,
message
:
"统计点账号不能为空,请输入统计点账号"
,
trigger
:
"blur"
}
],
password
:[
{
required
:
true
,
validator
:
validatePassword
,
trigger
:
[
'blur'
,
'change'
]
},
],
comfirmPassword
:[
{
required
:
true
,
validator
:
validateConfirmPassword
,
trigger
:
[
'blur'
,
'change'
]
}
],
levelValue
:[
{
required
:
true
,
message
:
"统计点所属层级不能为空,请选择统计点层级"
,
trigger
:
'change'
}
],
}
};
},
...
...
@@ -272,11 +405,17 @@ export default {
/** 查询统计点列表 */
getList
()
{
this
.
loading
=
true
;
list
Point
(
this
.
queryParams
).
then
(
response
=>
{
list
ByProvince
(
this
.
queryParams
).
then
(
response
=>
{
this
.
pointList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
// listPoint(this.queryParams).then(response => {
// this.pointList = response.rows;
// this.total = response.total;
// this.loading = false;
// });
},
// 取消按钮
cancel
()
{
...
...
@@ -296,7 +435,8 @@ export default {
superiorId
:
null
,
type
:
null
,
createTime
:
null
,
updateTime
:
null
updateTime
:
null
,
levelValue
:
null
,
};
this
.
resetForm
(
"form"
);
},
...
...
@@ -318,7 +458,8 @@ export default {
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
statisticsPointsType
=
''
;
this
.
statisticsPointsType
=
''
;
//初始化统计点类型
this
.
passwordPercent
=
0
;
//初始化密码进度条
this
.
addStatisticsTypeStatus
=
true
;
},
//选择新增类型确定按钮
...
...
@@ -335,20 +476,33 @@ export default {
this
.
title
=
"添加"
+
titleName
+
"统计点"
;
//获取所有统计点级联数据
this
.
cascadeList
();
},
//获取所有统计点级联数据
cascadeList
(){
if
(
this
.
statisticsPointsType
!=
'1'
){
cascadeList
(
this
.
statisticsPointsType
).
then
(
res
=>
{
this
.
levelOptions
=
res
.
data
;
});
}
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
passwordPercent
=
0
;
//初始化密码进度条
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
const
id
=
row
.
id
||
this
.
ids
;
getPoint
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
form
.
levelValue
=
JSON
.
parse
(
response
.
data
.
levelValue
)
console
.
log
(
this
.
form
.
levelValue
)
this
.
open
=
true
;
this
.
title
=
"修改统计点"
;
this
.
statisticsPointsType
=
response
.
data
.
type
;
this
.
form
.
password
=
""
;
//获取所有统计点级联数据
this
.
cascadeList
();
});
},
/** 提交按钮 */
...
...
@@ -357,23 +511,33 @@ export default {
setTimeout
(()
=>
{
this
.
repeatSubmit
=
false
//点击一次时隔两秒后才能再次点击
},
2000
)
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
type
=
this
.
statisticsPointsType
;
//统计点类型
this
.
form
.
superiorId
=
this
.
levelValue
[
this
.
levelValue
.
length
-
1
];
//上级id
this
.
form
.
superiorId
=
this
.
form
.
levelValue
[
this
.
form
.
levelValue
.
length
-
1
];
//上级id
this
.
form
.
levelValue
=
JSON
.
stringify
(
this
.
form
.
levelValue
)
if
(
this
.
form
.
id
!=
null
)
{
updatePoint
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
if
(
response
.
code
===
200
){
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
else
{
this
.
form
.
levelValue
=
JSON
.
parse
(
this
.
form
.
levelValue
)
}
});
}
else
{
addPoint
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
if
(
response
.
code
===
200
){
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
else
{
this
.
form
.
levelValue
=
JSON
.
parse
(
this
.
form
.
levelValue
)
}
});
}
}
...
...
@@ -382,7 +546,7 @@ export default {
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除统计点
编号为"'
+
ids
+
'"的
数据项?'
,
"警告"
,
{
this
.
$confirm
(
'是否确认删除统计点数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
...
...
@@ -411,7 +575,28 @@ export default {
return
(
this
.
queryParams
.
pageNum
-
1
)
*
this
.
queryParams
.
pageSize
+
index
+
1
},
handleChange
(
value
)
{
console
.
log
(
value
);
// console.log(value);
},
passwordPercentFormat
(
percentage
){
return
percentage
===
100
?
'符合'
:
`不符`
;
},
//树形表格懒加载
load
(
tree
,
treeNode
,
resolve
)
{
setTimeout
(()
=>
{
resolve
([
{
id
:
31
,
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
id
:
32
,
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
}
])
},
1000
)
}
}
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论