123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <template>
- <div id="modelFile">
- <span class="modelFile" style="margin-right: 12px;">模型文件</span>
- <el-cascader :options="options" :props="props" :show-all-levels="false" @change="handleChange" style="width:160px;"
- clearable placeholder="请选择模型文件" v-model="casVal"></el-cascader>
- </div>
- </template>
- <script>
- import tools from "@/utils/scan/tools"
- import { queryModelFile } from "@/api/data_admin/buildTaskApi"
- import { mapGetters, mapActions } from "vuex"
- export default {
- computed: {
- ...mapGetters("layout", [ "projectId", "secret", "userId" ])
- },
- data() {
- return {
- casVal: [],
- options: [],
- modelIdToFloorId: {},
- props: {
- value: "FileId",
- label: "FileName",
- children: "FileList"
- },
- };
- },
- created() {
- this.init()
- },
- watch: {
- projectId() {
- this.casVal =[]
- this.options = []
- this.init()
- }
- },
- methods: {
-
- setValue(val) {
- if (val && val.length) {
- this.casVal = val
- }
- },
-
- init() {
- this.getDirectory()
- },
-
- getDirectory() {
- queryModelFile("", res => {
- this.options = res.Content.map(item => {
- item.FileId = item.FolderId
- item.FileName = item.FolderName
- return item
- })
- });
- },
-
- handleChange(value) {
- this.$emit("change", value)
- }
- }
- };
- </script>
- <style lang="less">
- .el-cascader .el-input .el-input__inner {
- vertical-align: bottom;
- }
- </style>
- <style lang="less" scoped>
- #modelFile {
- margin-left: 10px;
- float: left;
- .modelFile {
- color: #999999;
- font-size: 14px;
- }
- }
- </style>
|