|
@ -248,7 +248,21 @@ |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col>--> |
|
|
</el-col>--> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="行政区划" prop="xzqhId"> |
|
|
|
|
|
<el-cascader |
|
|
|
|
|
:options="areasOptions" |
|
|
|
|
|
v-model="form.xzqhId" |
|
|
|
|
|
:props="areasOptionProps" |
|
|
|
|
|
placeholder="请选择行政区划" |
|
|
|
|
|
clearable |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
@change="handleChange" |
|
|
|
|
|
> |
|
|
|
|
|
</el-cascader> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="SLOGAN"> |
|
|
<el-form-item label="SLOGAN"> |
|
@ -539,7 +553,7 @@ import Treeselect from "@riophae/vue-treeselect"; |
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
|
|
|
|
|
|
import { getFile } from "@/api/common"; |
|
|
import { getFile } from "@/api/common"; |
|
|
|
|
|
import { getAreasData } from "@/api/areas/index"; |
|
|
|
|
|
|
|
|
import myaxios from "axios"; |
|
|
import myaxios from "axios"; |
|
|
|
|
|
|
|
@ -553,6 +567,16 @@ export default { |
|
|
components: { Treeselect }, |
|
|
components: { Treeselect }, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
areasOptionProps: { |
|
|
|
|
|
emitPath: false, |
|
|
|
|
|
checkStrictly: true, //选择任意一级 |
|
|
|
|
|
// lazy: true, |
|
|
|
|
|
// lazyLoad: function qylazyLoad(node) { |
|
|
|
|
|
// // node.level = 5; |
|
|
|
|
|
// console.log("node", node.level); |
|
|
|
|
|
// }, |
|
|
|
|
|
}, |
|
|
|
|
|
areasOptions: [], |
|
|
uploadForm: new FormData(), |
|
|
uploadForm: new FormData(), |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
list: [], |
|
|
list: [], |
|
@ -637,6 +661,9 @@ export default { |
|
|
trigger: "blur", |
|
|
trigger: "blur", |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
|
|
|
xzqhId: [ |
|
|
|
|
|
{ required: true, message: "行政区划不能为空", trigger: "blur" }, |
|
|
|
|
|
], |
|
|
}, |
|
|
}, |
|
|
//全选 |
|
|
//全选 |
|
|
checkTags: false, |
|
|
checkTags: false, |
|
@ -645,11 +672,12 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
|
|
|
this.getTreeData(); |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
this.getDicts("sys_normal_disable").then((response) => { |
|
|
this.getDicts("sys_normal_disable").then((response) => { |
|
|
this.statusOptions = response.data; |
|
|
this.statusOptions = response.data; |
|
|
}); |
|
|
}); |
|
|
this.getDicts('characteristic_type').then((response) => { |
|
|
this.getDicts("characteristic_type").then((response) => { |
|
|
this.dataTypes = response.data; |
|
|
this.dataTypes = response.data; |
|
|
}); |
|
|
}); |
|
|
this.getDicts("sys_notice_status").then((response) => { |
|
|
this.getDicts("sys_notice_status").then((response) => { |
|
@ -669,12 +697,39 @@ export default { |
|
|
// }); |
|
|
// }); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
getTreeData() { |
|
|
|
|
|
getAreasData().then((items) => { |
|
|
|
|
|
let res = []; |
|
|
|
|
|
let getChildren = (res, pid) => { |
|
|
|
|
|
for (const i of items.data) { |
|
|
|
|
|
if (i.parentid === pid) { |
|
|
|
|
|
const newItem = { |
|
|
|
|
|
label: i.name, |
|
|
|
|
|
value: i.id, |
|
|
|
|
|
}; |
|
|
|
|
|
if (i.layer != 3) newItem.children = []; |
|
|
|
|
|
res.push(newItem); |
|
|
|
|
|
getChildren(newItem.children, newItem.value); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
getChildren(res, items.data[0].parentid); |
|
|
|
|
|
console.log("areasOptions", res); |
|
|
|
|
|
this.areasOptions = res; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
handleChange(value) { |
|
|
|
|
|
//value为省市区code数组 |
|
|
|
|
|
if (value) { |
|
|
|
|
|
console.log("value", value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
handleRouter(path, row) { |
|
|
handleRouter(path, row) { |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
path: path, |
|
|
path: path, |
|
|
query: { |
|
|
query: { |
|
|
deptId: row.id, |
|
|
deptId: row.id, |
|
|
name:row.deptName |
|
|
name: row.deptName, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -818,7 +873,13 @@ export default { |
|
|
if (this.queryParams.deptName || this.queryParams.status) { |
|
|
if (this.queryParams.deptName || this.queryParams.status) { |
|
|
this.deptList = response.data; |
|
|
this.deptList = response.data; |
|
|
} else { |
|
|
} else { |
|
|
this.deptList = this.handleTree(response.data, "id","parentId","children","0"); |
|
|
this.deptList = this.handleTree( |
|
|
|
|
|
response.data, |
|
|
|
|
|
"id", |
|
|
|
|
|
"parentId", |
|
|
|
|
|
"children", |
|
|
|
|
|
"0" |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
this.loading = false; |
|
|
this.loading = false; |
|
|
}); |
|
|
}); |
|
|