@houaoran/designer 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houaoran/designer",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。",
5
5
  "unpkg": "./dist/index.umd.js",
6
6
  "jsdelivr": "./dist/index.umd.js",
@@ -15,6 +15,7 @@
15
15
  </template>
16
16
  <script>
17
17
  import { defineComponent } from 'vue';
18
+ import { getDictOptions } from '../utils/dict';
18
19
  export default defineComponent({
19
20
  name: 'DictSelect',
20
21
  emits: ['update:modelValue', 'change'],
@@ -39,12 +40,16 @@ export default defineComponent({
39
40
 
40
41
  computed: {
41
42
  dictOptions() {
42
- const { v } = JSON.parse(sessionStorage.getItem('dictCache') ?? '{}') ?? {} ?? {}
43
- console.log(v, 'v');
44
- const data = JSON.parse(v ?? '{}') ?? {}
45
- console.log(data, 'data');
46
- return data[this.dictCode]
43
+ return getDictOptions(this.dictCode)
47
44
  },
45
+ value: {
46
+ get() {
47
+ return this.modelValue ?? null
48
+ },
49
+ set(val) {
50
+ this.update(val)
51
+ }
52
+ }
48
53
  },
49
54
  methods: {
50
55
 
@@ -6,7 +6,7 @@ const name = 'dictSelect';
6
6
 
7
7
  export default {
8
8
  menu: 'main',
9
- icon: 'icon-select',
9
+ icon: 'icon-dict',
10
10
  label,
11
11
  name,
12
12
  input: true,
@@ -32,8 +32,8 @@ export default {
32
32
  {type: 'input', field: 'dictCode', value: ''},
33
33
  {type: 'select', field: 'type', value: 'select', options: [
34
34
  {label: '选择器', value: 'select'},
35
- {label: '复选框', value: 'checkbox'},
36
- {label: '单选框', value: 'radio'},
35
+ {label: '多选', value: 'checkbox'},
36
+ {label: '单选', value: 'radio'},
37
37
  ]},
38
38
  ]);
39
39
  },
package/src/form/index.js CHANGED
@@ -5,7 +5,7 @@ import SignaturePad from '../components/SignaturePad.vue';
5
5
  import TableForm from '../components/tableForm/TableForm.vue';
6
6
  import Table from '../components/table/Table.vue';
7
7
  import InputRange from '../components/InputRange.vue';
8
- import DictSelect from '../components/dictSelect.vue';
8
+ import DictSelect from '../components/DictSelect.vue';
9
9
  import '../style/icon.css';
10
10
 
11
11
  const install = (formCreate) => {
@@ -767,7 +767,7 @@ const ZhCn = {
767
767
  name: '字典选择',
768
768
  props: {
769
769
  disabled: '是否禁用',
770
- dictCode: '字典代码',
770
+ dictCode: '字典编码',
771
771
  type: '类型',
772
772
  }
773
773
  },
@@ -0,0 +1,6 @@
1
+ export const getDictOptions = (dictCode) => {
2
+ const {v} = JSON.parse(sessionStorage.getItem('dictCache') ?? '{}') ?? {} ?? {}
3
+ const data = JSON.parse(v ?? '{}') ?? {}
4
+ console.log(data, 'data');
5
+ return data[dictCode]
6
+ }