• vue 动态表单优秀案例


    不同的下拉框 就会显示不同的表单,表单配置是灵活匹配的,还有就是 一定要知道都有哪些类型的数据做到兼容起来。

    在这里插入图片描述

    app.vue

    <template>
      <a-select v-model:value="FormDataSelect" :options="FormDataSelectList" />
    
      <a-form class="FormView" :label-col="labelCol" v-if="FormData.BasicParam">
    
        <template v-for="(item, index) in formList.Data[FormDataSelect]">
          <div class="title" v-if="item.show">{{ item.title }}div>
          <span v-if="item.show" v-for="(itemc, indexc) in item.children">
            <InputVue :key="'InputVue' + indexc" v-if="itemc.type === 'InputVue' && itemc.show" :label="itemc.name"
              v-model="itemc.value" />
            <SelectVue :key="'SelectVue' + indexc" v-if="itemc.type === 'SelectVue' && itemc.show" :label="itemc.name"
              :dist-name="itemc.distName" v-model="itemc.value" @select="selectValue(itemc)" />
            <InputNumberVue :key="'InputNumberVue' + indexc" v-if="itemc.type === 'InputNumberVue' && itemc.show"
              :label="itemc.name" :unit="itemc.unit" v-model="itemc.value" />
          span>
        template>
    
        <a-form-item class="ButtonView">
          <a-button type="primary" style="margin-left:150px" @click="ShowFormData">提交a-button>
        a-form-item>
    
      a-form>
    
      <a-modal v-model:visible="visible" title="测试数据结果">
        <code>
          <pre>{{ Code }}pre>
        code>
      a-modal>
    template>
    <script setup>
    import { nextTick, onMounted, ref, watch, reactive } from 'vue';
    import { GetFormData } from './Apis.js'
    import InputVue from './Input.vue';
    import InputNumberVue from './InputNumber.vue';
    import SelectVue from './Select.vue';
    
    // 表单标签布局
    const labelCol = ref({ style: { width: '150px', } });
    
    // 表单数据
    const FormData = ref({});
    const FormDataSelect = ref('TestFormData1');
    const FormDataSelectList = ref([
      { value: 'TestFormData1', label: '测试表单数据1', },
      { value: 'TestFormData2', label: '测试表单数据2', },
      { value: 'TestFormData3', label: '测试表单数据3', }
    ]);
    let formList = reactive({ Data: {} })
    function dataS(datas, key) {
      if (!formList.Data.hasOwnProperty(key)) {
        formList.Data[key] = []
        if (datas.BasicParam) {
          let BasicParam = {
            title: '装备信息',
            show: true,
            children: [{
              name: '装备名称',
              key: 'BasicParam.EquipModel',
              FormType: datas.BasicParam.FormType,
              EquipId: datas.BasicParam.EquipId,
              value: datas.BasicParam.EquipModel,
              type: 'InputVue',
              show: true,
            }, {
              name: '最大作用距离',
              key: 'BasicParam.Distance',
              value: datas.BasicParam.Distance,
              type: 'InputNumberVue',
              unit: 'km',
              show: true,
            }, {
              name: '收发共用天线',
              key: 'TranRevList[0].IsER',
              value: datas.TranRevList[0].IsER,
              type: 'SelectVue',
              distName: '是否类型',
              show: datas.TranRevList[0].TranParam != null && datas.TranRevList[0].RevParam != null,
            }]
          }
          formList.Data[key].push(BasicParam)
        }
        if (datas.TranRevList.length > 0) {
          if (datas.TranRevList[0].TranParam) {
            let TranParam = {
              title: '发射机参数',
              show: true,
              children: [{
                name: '频率类型',
                key: 'TranRevList[0].TranParam.FreqType',
                value: datas.TranRevList[0].TranParam.FreqType,
                type: 'SelectVue',
                distName: '频率类型',
                show: true,
              }, {
                name: '发射频率起',
                key: 'TranRevList[0].TranParam.FreqFrom',
                value: datas.TranRevList[0].TranParam.FreqFrom,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].TranParam.FreqType === '1' ? true : false,
              }, {
                name: '发射频率止',
                key: 'TranRevList[0].TranParam.FreqTo',
                value: datas.TranRevList[0].TranParam.FreqTo,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].TranParam.FreqType === '1' ? true : false,
              }, {
                name: '中心频率',
                key: 'TranRevList[0].TranParam.FreqCenter',
                value: datas.TranRevList[0].TranParam.FreqCenter,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].TranParam.FreqType === '0' ? true : false,
              }, {
                name: '占用带宽',
                key: 'TranRevList[0].TranParam.OccupyBand',
                value: datas.TranRevList[0].TranParam.OccupyBand,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].TranParam.FreqType === '0' ? true : false,
              }]
            }
            formList.Data[key].push(TranParam)
          }
          if (datas.TranRevList[0].TranAntData) {
            let TranAntData = {
              title: datas.TranRevList[0].IsER === '0' ? '发射机天线参数' : '公共天线参数',
              show: datas.TranRevList[0].IsER === '0' ? true : false,
              children: [{
                name: '天线类型',
                key: 'TranRevList[0].TranAntData.AntType',
                value: datas.TranRevList[0].TranAntData.AntType,
                type: 'SelectVue',
                distName: '天线类型',
                show: true,
              }, {
                name: '极化方式',
                key: 'TranRevList[0].TranAntData.Pola',
                value: datas.TranRevList[0].TranAntData.Pola,
                type: 'SelectVue',
                distName: '极化方式',
                show: true,
              }]
            }
            formList.Data[key].push(TranAntData)
          }
          if (datas.TranRevList[0].RevParam) {
            let RevParam = {
              title: '接收机参数',
              show: true,
              children: [{
                name: '频率类型',
                key: 'TranRevList[0].RevParam.FreqType',
                value: datas.TranRevList[0].RevParam.FreqType,
                type: 'SelectVue',
                distName: '频率类型',
                show: true,
              }, {
                name: '发射频率起',
                key: 'TranRevList[0].RevParam.FreqFrom',
                value: datas.TranRevList[0].RevParam.FreqFrom,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].RevParam.FreqType === '1' ? true : false,
              }, {
                name: '发射频率止',
                key: 'TranRevList[0].RevParam.FreqTo',
                value: datas.TranRevList[0].RevParam.FreqTo,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].RevParam.FreqType === '1' ? true : false,
              }, {
                name: '接收中心频率',
                key: 'TranRevList[0].RevParam.FreqCenter',
                value: datas.TranRevList[0].RevParam.FreqCenter,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].RevParam.FreqType === '0' ? true : false,
              }, {
                name: '接收带宽',
                key: 'TranRevList[0].RevParam.BandWidth',
                value: datas.TranRevList[0].RevParam.BandWidth,
                type: 'InputNumberVue',
                unit: 'MHz',
                show: datas.TranRevList[0].RevParam.FreqType === '0' ? true : false,
              }]
            }
            formList.Data[key].push(RevParam)
          }
          if (datas.TranRevList[0].RevAntData) {
            let RevAntData = {
              title: '接收机天线参数',
              show: true,
              children: [{
                name: '天线类型',
                key: 'TranRevList[0].RevAntData.AntType',
                value: datas.TranRevList[0].RevAntData.AntType,
                type: 'SelectVue',
                distName: '天线类型',
                show: true,
              }, {
                name: '极化方式',
                key: 'TranRevList[0].RevAntData.Pola',
                value: datas.TranRevList[0].RevAntData.Pola,
                type: 'SelectVue',
                distName: '极化方式',
                show: true,
              }]
            }
            formList.Data[key].push(RevAntData)
          }
          if (datas.TranRevList[0].TranAntData) {
            let TranAntData = {
              title: '公共天线参数',
              show: datas.TranRevList[0].IsER === '1' ? true : false,
              children: [{
                name: '天线类型',
                key: 'TranRevList[0].TranAntData.AntType',
                value: datas.TranRevList[0].TranAntData.AntType,
                type: 'SelectVue',
                distName: '天线类型',
                show: true,
              }, {
                name: '极化方式',
                key: 'TranRevList[0].TranAntData.Pola',
                value: datas.TranRevList[0].TranAntData.Pola,
                type: 'SelectVue',
                distName: '极化方式',
                show: true,
              }]
            }
            formList.Data[key].push(TranAntData)
          }
        }
      }
    }
    function selectValue(params) {
      // 收发共用天线
      if (params.key === "TranRevList[0].IsER") {
        let index = formList.Data[FormDataSelect.value].findIndex(item => { return item.title === '发射机天线参数' })
        let index2 = formList.Data[FormDataSelect.value].findIndex(item => { return item.title === '公共天线参数' })
        let index3 = formList.Data[FormDataSelect.value].findIndex(item => { return item.title === '接收机天线参数' })
        // 是1 否0
        formList.Data[FormDataSelect.value][index].show = params.value === '1' ? false : true
        formList.Data[FormDataSelect.value][index2].show = params.value === '1' ? true : false
        formList.Data[FormDataSelect.value][index3].show = params.value === '1' ? false : true
      }
      let arrl = ["TranRevList[0].RevParam.FreqType", "TranRevList[0].TranParam.FreqType"]
      if (arrl.includes(params.key)) {
        var TranParamindex1 = null;
        for (let index = 0; index < formList.Data[FormDataSelect.value].length; index++) {
          const array = formList.Data[FormDataSelect.value][index].children;
          for (let i = 0; i < array.length; i++) {
            const element = array[i];
            if (element.key === params.key) {
              TranParamindex1 = index
              break
            }
          }
        }
        formList.Data[FormDataSelect.value][TranParamindex1].children[1].show = params.value === '1' ? true : false
        formList.Data[FormDataSelect.value][TranParamindex1].children[2].show = params.value === '1' ? true : false
        formList.Data[FormDataSelect.value][TranParamindex1].children[3].show = params.value === '0' ? true : false
        formList.Data[FormDataSelect.value][TranParamindex1].children[4].show = params.value === '0' ? true : false
      }
    }
    onMounted(async () => {
      FormData.value = await GetFormData(FormDataSelect.value);
      dataS(FormData.value, FormDataSelect.value)
    });
    
    watch(FormDataSelect, (val) => {
      FormData.value = {};
      nextTick(async () => {
        FormData.value = await GetFormData(val);
        dataS(FormData.value, val)
      })
    })
    
    const Code = ref('');
    const visible = ref(false);
    
    const ShowFormData = () => {
      let formV = JSON.parse(JSON.stringify(formList.Data[FormDataSelect.value]))
      for (let index = 0; index < formV.length; index++) {
        const array = formV[index].children;
        for (let i = 0; i < array.length; i++) {
          let val = array[i].value
          new Function("val", "FormData", "FormData.value." + array[i].key + " = val")(val, FormData);
        }
      }
      Code.value = JSON.stringify(FormData.value, 1, '    ');
      visible.value = true
    }
    script>
    
    <style scoped>
    .ButtonView {
      margin-top: 20px;
    }
    
    .FormView {
      width: 500px;
    }
    
    .title {
      padding: 10px;
      margin-bottom: 10px;
      border-bottom: 1px solid #434343;
    }
    
    :deep(.ant-form-item) {
      margin-bottom: 0px;
    }
    style>
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317

    Input.vue

    <template>
        <a-form-item :label="label">
            <a-input size="small" v-model:value="InputValue">
                <template #suffix>
                    {{ unit }}
                template>
            a-input>
        a-form-item>
    template>
    <script setup>
    import { ref, watch } from 'vue';
    
    const emit = defineEmits(['update:modelValue'])
    const props = defineProps({
        // 名称
        label: String,
        // 单位
        unit: String,
        // 表单数据
        modelValue: String,
    });
    
    const InputValue = ref();
    
    watch(() => props.modelValue, val => {
        InputValue.value = val;
    }, { immediate: true });
    
    watch(InputValue, (val) => {
        emit('update:modelValue', val);
    })
    
    script>
    <style lang="less" scoped>
    
    style>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36

    InputNumber.vue

    <template>
        <a-form-item :label="label">
            <a-input-number size="small" style="width:100%" v-model:value="InputValue" :controls="false"
                :addon-after="unit" />
        a-form-item>
    template>
    <script setup>
    import { ref, watch } from 'vue';
    
    const emit = defineEmits(['update:modelValue'])
    const props = defineProps({
        // 名称
        label: String,
        // 单位
        unit: String,
        // 表单数据
        modelValue: Number,
    });
    
    const InputValue = ref();
    
    watch(() => props.modelValue, val => {
        InputValue.value = val;
    }, { immediate: true });
    
    watch(InputValue, (val) => {
        emit('update:modelValue', val);
    })
    
    script>
    <style lang="less" scoped>
    
    style>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33

    Select.vue

    <template>
        <a-form-item :label="label">
            <a-select size="small" v-model:value="SelectValue">
                <a-select-option v-for="item in Dist" :key="item.DM" :value="item.DM">
                    {{ item.MC }}
                a-select-option>
            a-select>
        a-form-item>
    template>
    <script setup>
    import { onMounted, ref, watch } from 'vue';
    import { GetDist } from './Apis.js'
    import { UseRateStore } from './store.js'
    const store = UseRateStore();
    const emit = defineEmits(['update:modelValue', 'select'])
    const props = defineProps({
        // 名称
        label: String,
        // 字典名称
        distName: String || Array,
        // 表单数据
        modelValue: String || Number,
    });
    
    const SelectValue = ref();
    
    watch(() => props.modelValue, val => {
        SelectValue.value = val;
    }, { immediate: true });
    
    watch(SelectValue, (val) => {
        emit('update:modelValue', val);
        emit('select', val);
    })
    // 字典列表
    const Dist = ref([]);
    
    onMounted(async () => {
        let item = store.getData(props.distName)
        if (item) {
            Dist.value = item
        } else {
            GetDist(props.distName).then(res => {
                store.setData({ key: props.distName, value: res })
                Dist.value = res
            });
        }
    });
    
    script>
    <style lang="less" scoped>
    
    style>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53

    store.js

    import {
        defineStore
    } from 'pinia'
    export const UseRateStore = defineStore('storeDist', {
        state: () => {
            return {
                DistData: {},
            }
        },
        getters: {
    
        },
        actions: {
            setData(data) {
                this.DistData[data.key] = data.value
            },
            getData(key) {
                return this.DistData[key] ? this.DistData[key] : null
            },
        }
    });
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    Apis.js

    // DMLX 代码类型
    // DM 代码
    // MC 名称
    const Dist = {
        '频率类型': [
            { "DMLX": "频率类型", "DM": "0", "MC": "频点" },
            { "DMLX": "频率类型", "DM": "1", "MC": "频段" }
        ],
        '天线类型': [
            { "DMLX": "天线类型", "DM": "0", "MC": "全向天线" },
            { "DMLX": "天线类型", "DM": "1", "MC": "非全向天线" }
        ],
        '极化方式': [
            { "DMLX": "极化方式", "DM": "H", "MC": "水平线极化" },
            { "DMLX": "极化方式", "DM": "V", "MC": "垂直线极化" },
            { "DMLX": "极化方式", "DM": "CL", "MC": "左旋圆极化" },
            { "DMLX": "极化方式", "DM": "CR", "MC": "右旋圆极化" },
            { "DMLX": "极化方式", "DM": "OD", "MC": "正交双线极化" }
        ],
        '是否类型': [
            { "DMLX": "是否类型", "DM": "0", "MC": "否" },
            { "DMLX": "是否类型", "DM": "1", "MC": "是" }
        ],
    }
    
    const FormData = {
        'TestFormData1': { 
            "BasicParam": {
                "FormType": 10,
                "EquipId": 21985,
                "EquipModel": "测试装备类型1", // 装备名称
                "Distance": 555.6, // 最大作用距离
            },
            "TranRevList": [{
                "IsER": "0", // 是否公用天线
                "TranParam": { // 发射机
                    "FreqType": "0", // 频率类型
                    "FreqFrom": 7.4985, // 发射频率起
                    "FreqTo": 7.5015, // 发射频率止
                    "FreqCenter": 7.5, // 中心频率
                    "OccupyBand": 0.003, // 占用带宽
                },
                "RevParam": { // 接收机
                    "FreqType": "0",
                    "FreqFrom": 7.4985, // 接收频率起
                    "FreqTo": 7.5015, // 接收频率止
                    "FreqCenter": 7.5, // 接收中心频率
                    "BandWidth": 0.003, // 接收带宽
                },
                "TranAntData": { // 发射机天线参数
                    "AntType": "0", // 天线类型
                    "Pola": "H", // 极化方式
                },
                "RevAntData": { // 接收机天线参数
                    "AntType": "0", // 天线类型
                    "Pola": "H",// 极化方式
                }
            }]
        },
        'TestFormData2': {
            "BasicParam": {
                "FormType": 20,
                "EquipId": 21985,
                "EquipModel": "测试装备类型2", // 装备名称
                "Distance": 555.6, // 最大作用距离
            },
            "TranRevList": [{
                "IsER": "0", // 是否公用天线
                "TranParam": null,
                "RevParam": { // 接收机
                    "FreqType": "0",
                    "FreqFrom": 7.4985, // 接收频率起
                    "FreqTo": 7.5015, // 接收频率止
                    "FreqCenter": 7.5, // 接收中心频率
                    "BandWidth": 0.003, // 接收带宽
                },
                "TranAntData": null,
                "RevAntData": { // 接收机天线参数
                    "AntType": "0", // 天线类型
                    "Pola": "H",// 极化方式
                },
            }]
        },
        'TestFormData3': {
            "BasicParam": {
                "FormType": 30,
                "EquipId": 21985,
                "EquipModel": "测试装备类型3", // 装备名称
                "Distance": 555.6, // 最大作用距离
            },
            "TranRevList": [{
                "IsER": "0", // 是否公用天线
                "TranParam": { // 发射机
                    "FreqType": "0", // 频率类型
                    "FreqFrom": 7.4985, // 发射频率起
                    "FreqTo": 7.5015, // 发射频率止
                    "FreqCenter": 7.5, // 中心频率
                    "OccupyBand": 0.003, // 占用带宽
                },
                "RevParam": null,
                "TranAntData": { // 发射机天线参数
                    "AntType": "0", // 天线类型
                    "Pola": "H", // 极化方式
                },
                "RevAntData": null
            }]
        }
    };
    
    /**
     * 获取表单数据
     *
     * @export
     * @return {*} 
     */
    export function GetFormData(TestKey = 'TestFormData1') {
        return new Promise((resolve, reject) => {
            resolve(FormData[TestKey]);
        });
    };
    
    
    /**
     * 获取字典数据
     *
     * @export
     * @param {String} DistName 字典名称
     * @return {Array} 字典项 
     */
    export function GetDist(DistName) {
        return new Promise((resolve, reject) => {
            console.log('获取字典项' + DistName);
            if (Dist[DistName]) {
                resolve(Dist[DistName]);
            } else {
                console.error('字典不存在');
                reject('字典不存在');
            }
        });
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
  • 相关阅读:
    SpringMVC的简单介绍及其使用
    第八章 Linux文件系统权限
    e签宝,再「进化」
    嵌入式Linux驱动开发(同步与互斥专题)(二)
    【文件I/O】标准IO:库函数
    uniapp 在 onLoad 事件中 this.$refs 娶不到的问题
    【平衡二叉搜索树】细撕AVL树的插入操作
    Spring系列-bean标签内autowire属性应用
    VirtualFree函数逆向分析笔记
    【每日一题Day338】LC2582递枕头 | 模拟+数学
  • 原文地址:https://blog.csdn.net/qq_38946996/article/details/127988698