file upload and export

This commit is contained in:
cxc
2022-07-28 11:18:53 +08:00
parent 6f4a650962
commit 5983e1e31b
11 changed files with 282 additions and 119 deletions

View File

@ -3,13 +3,13 @@
:model-value="modelValue"
placeholder="请选择,支持搜索"
size="default"
:loading="siteList.length === 0"
:loading="dataStore.siteList.length === 0"
@change="valueChanged"
filterable
clearable
>
<el-option
v-for="item in siteList"
v-for="item in dataStore.siteList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -17,7 +17,6 @@
</el-select>
</template>
<script setup name="SiteOptions">
import { tenantSelect } from "@/api/subPlatform/tenant";
import useDataStore from "@/store/modules/data";
import { ref, toRefs } from "vue";
const props = defineProps({
@ -25,24 +24,25 @@ const props = defineProps({
type: [Number, String],
},
});
const { modelValue } = toRefs(props);
const dataStore = useDataStore();
const siteList = ref([]);
dataStore.setSiteList();
// const siteList = ref([]);
const emit = defineEmits(["update:modelValue"]);
// 获取站点列表
const getSiteList = async () => {
const { rows } = await tenantSelect();
siteList.value = rows;
dataStore.setSiteList(rows);
};
// // 获取站点列表
// const getSiteList = async () => {
// const { rows } = await tenantSelect();
// siteList.value = rows;
// dataStore.setSiteList(rows);
// };
const valueChanged = (val) => {
console.log("changed");
emit("update:modelValue", val);
};
getSiteList();
// getSiteList();
dataStore.setSiteList();
</script>