首页地图
This commit is contained in:
@ -64,8 +64,58 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { industry } from "@/api/config";
|
||||
|
||||
<script setup>
|
||||
import { listSysIndustry } from "@/api/config";
|
||||
import { reactive, toRefs } from "vue";
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, labelWidth } = toRefs(props);
|
||||
const data = reactive({
|
||||
rules: {
|
||||
industrys: [
|
||||
{
|
||||
type: "array",
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { rules } = toRefs(data);
|
||||
const levelI = ref([]);
|
||||
const levelII = ref([]);
|
||||
const levelIII = ref([]);
|
||||
|
||||
// 获取领域树形列表
|
||||
const getIndustryTreeData = async () => {
|
||||
const { data } = await listSysIndustry();
|
||||
levelI.value = data;
|
||||
};
|
||||
|
||||
const levelIChange = async (item) => {
|
||||
delete modelValue.value.industrys[1];
|
||||
delete modelValue.value.industrys[2];
|
||||
levelII.value = levelI.value.find((el) => {
|
||||
return el.id === item;
|
||||
}).children;
|
||||
};
|
||||
|
||||
const levelIIChange = async (item) => {
|
||||
delete modelValue.value.industrys[2];
|
||||
levelIII.value = levelII.value.find((el) => el.id === item).children;
|
||||
};
|
||||
getIndustryTreeData();
|
||||
</script>
|
||||
<!-- <script>
|
||||
// import { industry } from "@/api/config";
|
||||
export default {
|
||||
props: {
|
||||
modelValue: Object,
|
||||
@ -143,4 +193,4 @@ export default {
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script> -->
|
||||
|
Reference in New Issue
Block a user