提交 8c2283dd authored 作者: 林国禄's avatar 林国禄

初始化

上级 a4e8226d
import request from '@/utils/request'
// 查询统计点列表(级联列表)
export function cascadeList(type) {
return request({
url: '/backstage/point/cascadeList?type=' + type,
method: 'get'
})
}
// 查询统计点列表
export function listPoint(query) {
return request({
......@@ -50,4 +58,4 @@ export function exportPoint(query) {
method: 'get',
params: query
})
}
\ No newline at end of file
}
......@@ -164,25 +164,17 @@
<el-form-item label="密码" prop="password">
<el-input placeholder="请输入密码" v-model="form.password" show-password></el-input>
</el-form-item>
<!-- <el-form-item v-if="this.statisticsPointsType == '2'" label="所属省级" prop="password">-->
<!-- <el-select v-model="provinceId" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in provinceList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="所属层级" prop="password">
<el-form-item v-if="this.statisticsPointsType != '1'" label="所属层级" prop="password">
<div class="block">
<span class="demonstration">hover 触发子菜单</span>
<span class="demonstration"></span>
<el-cascader
style="width: 100%"
v-model="levelValue"
:options="levelOptions"
:props="{ expandTrigger: 'hover' }"
@change="handleChange"></el-cascader>
@change="handleChange"
clearable></el-cascader>
</div>
</el-form-item>
......@@ -211,116 +203,15 @@
</template>
<script>
import { listPoint, getPoint, delPoint, addPoint, updatePoint, exportPoint } from "@/api/backstage/point";
import { cascadeList, listPoint, getPoint, delPoint, addPoint, updatePoint, exportPoint } from "@/api/backstage/point";
export default {
name: "Point",
data() {
return {
//级联选择器相关
levelValue: [],
levelOptions: [{
value: 'zhinan',
label: '指南',
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}, {
value: 'fankui',
label: '反馈'
}, {
value: 'xiaolv',
label: '效率'
}, {
value: 'kekong',
label: '可控'
}]
}, {
value: 'daohang',
label: '导航',
children: [{
value: 'cexiangdaohang',
label: '侧向导航'
}, {
value: 'dingbudaohang',
label: '顶部导航'
}]
}]
}, {
value: 'zujian',
label: '组件',
children: [{
value: 'basic',
label: 'Basic',
children: [{
value: 'layout',
label: 'Layout 布局'
}, {
value: 'color',
label: 'Color 色彩'
}, {
value: 'typography',
label: 'Typography 字体'
}, {
value: 'icon',
label: 'Icon 图标'
}, {
value: 'button',
label: 'Button 按钮'
}]
}, {
value: 'notice',
label: 'Notice',
children: [{
value: 'alert',
label: 'Alert 警告'
}, {
value: 'loading',
label: 'Loading 加载'
}, {
value: 'message',
label: 'Message 消息提示'
}, {
value: 'message-box',
label: 'MessageBox 弹框'
}, {
value: 'notification',
label: 'Notification 通知'
}]
}, {
value: 'navigation',
label: 'Navigation',
}, {
value: 'others',
label: 'Others',
}]
}, {
value: 'ziyuan',
label: '资源',
children: [{
value: 'axure',
label: 'Axure Components'
}, {
value: 'sketch',
label: 'Sketch Templates'
}, {
value: 'jiaohu',
label: '组件交互文档'
}]
}],
provinceList: [],//省级列表
cityList: [],//市级列表
countyList: [],//县级列表
townshipList: [],//乡级列表
villageList: [],//村级列表
//所属省级id
provinceId: null,
levelOptions: [],
//统计点类型对象
statisticsPointsTypeObj: [
{label:1,name:"省级(省份/直辖市/自治区)"},
......@@ -429,9 +320,6 @@ export default {
handleAdd() {
this.statisticsPointsType = '';
this.addStatisticsTypeStatus = true;
// this.reset();
// this.open = true;
// this.title = "添加统计点";
},
//选择新增类型确定按钮
handleAddStatisticsPointsType(){
......@@ -446,94 +334,12 @@ export default {
this.open = true;
this.title = "添加"+titleName+"统计点";
//获取所有统计点数据并处理
listPoint().then(res=>{
let list = res.rows;
let provinceList = [];//省级列表
let cityList = [];//市级列表
let countyList = [];//县级列表
let townshipList = [];//乡级列表
let villageList = [];//村级列表
// list.map(item=>{
// if(item.type == "1"){
// provinceList.push(item);
// }else if(item.type == "2"){
// cityList.push(item);
// }else if(item.type == "3"){
// countyList.push(item);
// }else if(item.type == "4"){
// townshipList.push(item);
// }else if(item.type == "5"){
// villageList.push(item);
// }
// });
//
// this.provinceList = provinceList;
// this.cityList = cityList;
// this.countyList = countyList;
// this.townshipList = townshipList;
// this.villageList = villageList;
list.map(item=>{
if(item.type == "1"){
let options = {};//级联对象
options.value = item.id;
options.label = item.name;
options.children = [];
provinceList.push(options)
}else if(item.type == "2"){
let options = {};//级联对象
options.value = item.id;
options.label = item.name;
options.children = [];
cityList.push(options)
}else if(item.type == "3"){
let options = {};//级联对象
options.value = item.id;
options.label = item.name;
options.children = [];
countyList.push(options)
}else if(item.type == "4"){
let options = {};//级联对象
options.value = item.id;
options.label = item.name;
options.children = [];
townshipList.push(options)
}else if(item.type == "5"){
let options = {};//级联对象
options.value = item.id;
options.label = item.name;
options.children = [];
villageList.push(options)
}
//获取所有统计点级联数据
if(this.statisticsPointsType != '1'){
cascadeList(this.statisticsPointsType).then(res=>{
this.levelOptions = res.data;
});
this.provinceList = provinceList;
this.cityList = cityList;
this.countyList = countyList;
this.townshipList = townshipList;
this.villageList = villageList;
let optionsList = [];
if(this.statisticsPointsType == "2"){
provinceList.map(item=>{
item.children = cityList;
});
}else if(this.statisticsPointsType == "3"){
}else if(this.statisticsPointsType == "4"){
}else if(this.statisticsPointsType == "5"){
}else if(this.statisticsPointsType == "6"){
}
this.levelOptions = optionsList;
console.log(this.provinceList);
console.log(this.levelOptions);
});
}
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -555,6 +361,7 @@ export default {
if (valid) {
this.form.type = this.statisticsPointsType;//统计点类型
this.form.superiorId = this.levelValue[this.levelValue.length-1];//上级id
if (this.form.id != null) {
updatePoint(this.form).then(response => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论