修改所有页面站点 使用站点组件
This commit is contained in:
39
src/components/SiteOptions/index.vue
Normal file
39
src/components/SiteOptions/index.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<el-cascader
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
v-model="tenant_id"
|
||||
clearable
|
||||
separator="-"
|
||||
placeholder="请选择,支持搜索"
|
||||
:options="tenantOptions"
|
||||
filterable
|
||||
:props="{ emitPath: false, value: 'id', label: 'name' }"
|
||||
></el-cascader>
|
||||
</template>
|
||||
<script>
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tenantOptions: [],
|
||||
tenant_id: undefined,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
tenant_id(newVal, oldVal) {
|
||||
this.$emit("handleChange", newVal);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
tenantSelect().then((res) => {
|
||||
for (const key in res.data) {
|
||||
if (Object.hasOwnProperty.call(res.data, key)) {
|
||||
const item = res.data[key];
|
||||
this.tenantOptions.push(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user