zydx-plus 1.5.24 → 1.6.25

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": "zydx-plus",
3
- "version": "1.5.24",
3
+ "version": "1.6.25",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -16,7 +16,7 @@ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr
16
16
  let val = []
17
17
  if(type === 'input') {
18
18
  for(let i=0; i< inputArr.length; i++) {
19
- if(inputArr[i].type === 'input') {
19
+ if(inputArr[i].type === 'input' || inputArr[i].type === 'calender') {
20
20
  val.push(inputArr[i].value)
21
21
  }else {
22
22
  val.push(inputArr[i].selectValue)
@@ -18,6 +18,10 @@
18
18
  <div style="display: inline-block;">
19
19
  <Select v-if="item.type === 'select'" :options="item.option" v-model:value="item.selectValue"></Select>
20
20
  </div>
21
+ <div class="cal" v-if="item.type === 'calender'">
22
+ <input type="text" :placeholder="item.placeholder" @focus="focus" v-model="item.value" :disabled="item.disabled" />
23
+ <Calendar v-if="tip" style="top: 35px;" @confirm="confirm($event,item)"></Calendar>
24
+ </div>
21
25
  <div v-if="item.type === 'text'" class="text">{{ item.value }}</div>
22
26
  </div>
23
27
  </div>
@@ -34,9 +38,15 @@
34
38
 
35
39
  <script>
36
40
  import Select from '../../select/src/select.vue'
41
+ import Calendar from '../../calendar/src/Calendar'
37
42
  export default {
38
43
  name: 'zydx-tip-box',
39
- components: {Select},
44
+ components: {Select,Calendar},
45
+ data() {
46
+ return {
47
+ tip: false
48
+ }
49
+ },
40
50
  props: {
41
51
  type: { // 弹窗的提示标题
42
52
  type: String,
@@ -75,6 +85,15 @@ export default {
75
85
  type: Function,
76
86
  default: () => {}
77
87
  }
88
+ },
89
+ methods: {
90
+ focus() {
91
+ this.tip = true
92
+ },
93
+ confirm(e,data) {
94
+ data.value = e.start
95
+ this.tip = false
96
+ },
78
97
  }
79
98
  }
80
99
  </script>
@@ -100,7 +100,7 @@ font-size: 12px;
100
100
  line-height: 30px;
101
101
  padding-right: 10px;
102
102
  }
103
- .tip-input>input{
103
+ .tip-input input{
104
104
  width: 211px;
105
105
  height: 32px;
106
106
  box-sizing: border-box;
@@ -126,3 +126,7 @@ font-size: 12px;
126
126
  width: 210px;
127
127
  text-align: left;
128
128
  }
129
+ .cal{
130
+ display: inline-block;
131
+ position: relative;
132
+ }
@@ -0,0 +1,6 @@
1
+ import main from './src/treeList';
2
+
3
+ main.install = function(Vue) {
4
+ Vue.component(main.name, main);
5
+ };
6
+ export default main;
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <div class="list">
3
+ <div class="list-cont">
4
+ <div class="list-li" @click="listTap(item,index)" :class="{'list-active': active === index}" v-for="(item,index) in list" :key="index">
5
+ <div class="list-title">
6
+ <span>{{ index + 1 }}. {{ item[column[0].label] }}</span>
7
+ <button v-if="delShow" @click="del(item)">删除</button>
8
+ </div>
9
+ <div class="list-li-cont" v-if="active === index">
10
+ <p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{ item[it.label] }}</p>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: "zydx-tree-list",
20
+ data() {
21
+ return {
22
+ active: 0,
23
+ }
24
+ },
25
+ props: {
26
+ list: { // 数据列表
27
+ type: Array,
28
+ default: () => []
29
+ },
30
+ column: { // 数据列表
31
+ type: Array,
32
+ default: () => []
33
+ },
34
+ delShow: { //是否显示取消按钮
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ },
39
+ methods: {
40
+ del() {
41
+ this.$emit('del',data)
42
+ },
43
+ listTap(data,index) {
44
+ this.active = index
45
+ this.$emit('confirm',data)
46
+ },
47
+ }
48
+ }
49
+ </script>
50
+
51
+ <style scoped>
52
+ .list-title{
53
+ display: flex;
54
+ justify-content: center;
55
+ line-height: 30px;
56
+ }
57
+ .list-title>span{
58
+ flex: 1;
59
+ }
60
+ .list-title>button{
61
+ margin-left: 5px;
62
+ margin-top: 4px;
63
+ font-size: 12px;
64
+ background-color: transparent;
65
+ border: 1px solid #000;
66
+ border-radius: 3px;
67
+ padding: 2px 5px;
68
+ cursor: pointer;
69
+ height: 22px;
70
+ min-width: 60px;
71
+ }
72
+ .list{
73
+ padding: 0 10px;
74
+ cursor: pointer;
75
+ }
76
+ .list-li>span{
77
+ font-size: 16px;
78
+ line-height: 30px;
79
+ }
80
+ .list-li-cont{
81
+ font-size: 14px;
82
+ padding-left: 10px;
83
+ }
84
+ .list-active{
85
+ color: #e20808;
86
+ }
87
+ </style>
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ import Year from './components/year/index';
10
10
  import Table from './components/data_table/index';
11
11
  import buttonGroup from './components/buttonGroup/index';
12
12
  import spinner from './components/spinner/index';
13
+ import treeList from './components/treeList/index';
13
14
 
14
15
  const components = [
15
16
  Calendar,
@@ -21,7 +22,8 @@ const components = [
21
22
  Select,
22
23
  Year,
23
24
  Table,
24
- buttonGroup
25
+ buttonGroup,
26
+ treeList
25
27
  ];
26
28
 
27
29
  function install(app) {
@@ -33,7 +35,7 @@ function install(app) {
33
35
  }
34
36
 
35
37
  export default {
36
- version: '1.5.24',
38
+ version: '1.6.25',
37
39
  install,
38
40
  Calendar,
39
41
  Message,
@@ -46,6 +48,7 @@ export default {
46
48
  Select,
47
49
  Year,
48
50
  Table,
49
- buttonGroup
51
+ buttonGroup,
52
+ treeList
50
53
  };
51
54