Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zhongtai-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
chenweiping
zhongtai-ui
Commits
d2e301e9
提交
d2e301e9
authored
9月 07, 2021
作者:
林国禄
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
统计点管理
上级
c6331cf2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
91 行增加
和
69 行删除
+91
-69
point.js
src/api/backstage/point.js
+16
-1
index.vue
src/views/backstage/point/index.vue
+75
-68
没有找到文件。
src/api/backstage/point.js
浏览文件 @
d2e301e9
import
request
from
'@/utils/request'
// 修改统计点账号状态
export
function
changeStatus
(
id
)
{
return
request
({
url
:
'/backstage/point/changeStatus/'
+
id
,
method
:
'put'
})
}
// 查询统计点列表(级联列表)
// 查询统计点详细
export
function
listBySuperiorId
(
id
)
{
return
request
({
url
:
'/backstage/point/listBySuperiorId/'
+
id
,
method
:
'get'
})
}
// 查询统计点列表(省级列表)
export
function
listByProvince
(
query
)
{
return
request
({
url
:
'/backstage/point/listByProvince'
,
...
...
src/views/backstage/point/index.vue
浏览文件 @
d2e301e9
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<!--
<el-form-item
label=
"名称"
prop=
"name"
>
--
>
<!--
<el-input-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入名称"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />--
>
<!--
</el-form-item>
--
>
<el-form-item
label=
"名称"
prop=
"name"
>
<el-input
v-model=
"queryParams.name"
placeholder=
"请输入名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/
>
</el-form-item
>
<!--
<el-form-item
label=
"账号"
prop=
"account"
>
-->
<!--
<el-input-->
<!-- v-model="queryParams.account"-->
...
...
@@ -117,6 +117,7 @@
:data=
"pointList"
style=
"width: 100%"
row-key=
"id"
:indent=
"50"
border
lazy
:load=
"load"
...
...
@@ -125,12 +126,33 @@
<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=
"password"
/>
--
>
<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=
"上级id"
align=
"center"
prop=
"superiorId"
/>
-->
<el-table-column
label=
"统计点类型"
align=
"center"
prop=
"type"
>
<<template
scope=
"scope"
>
<span
v-if=
"scope.row.type == 1"
>
省级
</span>
<span
v-if=
"scope.row.type == 2"
>
市级
</span>
<span
v-if=
"scope.row.type == 3"
>
县级
</span>
<span
v-if=
"scope.row.type == 4"
>
乡级
</span>
<span
v-if=
"scope.row.type == 5"
>
村级
</span>
<span
v-if=
"scope.row.type == 6"
>
自然村
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
scope=
"scope"
>
<el-switch
v-model=
"scope.row.status"
active-color=
"#13ce66"
inactive-color=
"#ff4949"
active-value=
"0"
inactive-value=
"1"
@
change=
"changeStatus(scope.row)"
>
</el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
...
...
@@ -151,37 +173,6 @@
</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"
...
...
@@ -252,14 +243,14 @@
</template>
<
script
>
import
{
listByProvince
,
cascadeList
,
listPoint
,
getPoint
,
delPoint
,
addPoint
,
updatePoint
,
exportPoint
}
from
"@/api/backstage/point"
;
import
{
changeStatus
,
listBySuperiorId
,
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
)
//
console.log(value)
if
(
value
===
''
||
value
===
undefined
||
value
===
null
)
{
if
(
this
.
form
.
id
==
null
){
callback
(
new
Error
(
'如需新增统计点的相关信息,请输入统计点的密码后才能进行操作'
));
...
...
@@ -410,12 +401,6 @@ export default {
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
// listPoint(this.queryParams).then(response => {
// this.pointList = response.rows;
// this.total = response.total;
// this.loading = false;
// });
},
// 取消按钮
cancel
()
{
...
...
@@ -516,15 +501,19 @@ export default {
if
(
valid
)
{
this
.
form
.
type
=
this
.
statisticsPointsType
;
//统计点类型
if
(
this
.
statisticsPointsType
!==
"1"
){
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
=>
{
if
(
response
.
code
===
200
){
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
pointList
=
[];
//刷新
this
.
getList
();
}
else
{
this
.
form
.
levelValue
=
JSON
.
parse
(
this
.
form
.
levelValue
)
}
...
...
@@ -534,6 +523,7 @@ export default {
if
(
response
.
code
===
200
){
this
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
pointList
=
[];
//刷新
this
.
getList
();
}
else
{
this
.
form
.
levelValue
=
JSON
.
parse
(
this
.
form
.
levelValue
)
...
...
@@ -581,23 +571,40 @@ export default {
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 弄'
}
])
//通过上级id查询统计点列表(实现懒加载)
listBySuperiorId
(
tree
.
id
).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(()
=>
{
resolve
([])
});
},
1000
)
},
//改变账号状态
changeStatus
(
row
){
let
title
=
''
;
if
(
row
.
status
==
'0'
){
title
=
'启用'
;
}
else
{
title
=
'禁用'
;
}
this
.
$confirm
(
'是否确认'
+
title
+
'账号状态?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(()
=>
{
changeStatus
(
row
.
id
).
then
(
response
=>
{
this
.
msgSuccess
(
title
+
"成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}).
catch
(()
=>
{
this
.
getList
();
this
.
$message
.
error
(
'取消操作'
)
})
},
}
};
</
script
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论