zydx-plus 1.18.85 → 1.19.86

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.18.85",
3
+ "version": "1.19.86",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -24,10 +24,10 @@
24
24
  <p v-if="editorShow">附件列表:</p>
25
25
  <div class="enclosure-list" v-for="(item,index) in uploadAttData">
26
26
  <div class="enclosure-item">
27
- <span>{{ index + 1 }}. {{ (uploadType)? item.name : item.fileName }}</span>
27
+ <span>{{ index + 1 }}. {{ (item.name)? item.name : item.fileName }}</span>
28
28
  </div>
29
29
  <div class="enclosure-item en-but">
30
- <button class="but" v-if="seeShow" @click="see(index)">查看</button>
30
+ <button class="but" v-if="!item.name" @click="see(index)">查看</button>
31
31
  <button class="but" v-if="!item.name" @click="download(index)">下载</button>
32
32
  <button class="but" v-if="delShow" @click="del(index)">删除</button>
33
33
  </div>
@@ -102,17 +102,13 @@ export default {
102
102
  type: Boolean,
103
103
  default: true
104
104
  },
105
- seeShow: {
106
- type: Boolean,
107
- default: true
108
- },
109
105
  titleShow: {
110
106
  type: Boolean,
111
107
  default: true
112
108
  },
113
109
  uploadType: {
114
110
  type: Boolean,
115
- default: false
111
+ default: true
116
112
  },
117
113
  info: {
118
114
  type: String,
@@ -123,7 +119,7 @@ export default {
123
119
  default: true
124
120
  }
125
121
  },
126
- emits: ['see','complete','update:data'],
122
+ emits: ['see','del','complete','update:data'],
127
123
  watch:{
128
124
  data(e) {
129
125
  this.editor.commands.setContent(json2html({node: "root",child: (e.html === undefined)? [] : e.html}))
@@ -151,6 +147,9 @@ export default {
151
147
  },
152
148
  methods: {
153
149
  del(index) {
150
+ if(this.uploadAttData[index].name === undefined) {
151
+ this.$emit('del', this.uploadAttData[index])
152
+ }
154
153
  this.uploadAttData.splice(index, 1)
155
154
  },
156
155
  see(index) {
@@ -0,0 +1,7 @@
1
+ import main from './src/textarea';
2
+
3
+ main.install = function(Vue) {
4
+ Vue.component(main.name, main);
5
+ };
6
+
7
+ export default main;
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div class="text" :style="{'min-height': height + 'px'}" contenteditable="true" ref="textarea"></div>
3
+ </template>
4
+
5
+ <script>
6
+ import Textarea from "@/App.vue";
7
+
8
+ export default {
9
+ name: "zydx-textarea",
10
+ components: {Textarea},
11
+ props: {
12
+ value: {
13
+ type: String,
14
+ default: ''
15
+ },
16
+ height: {
17
+ type: Number,
18
+ default: 200
19
+ },
20
+ },
21
+ watch: {
22
+ value(val) {
23
+ this.$refs.textarea.innerHTML = val
24
+ }
25
+ },
26
+ mounted() {
27
+ this.$refs.textarea.innerHTML = this.value
28
+ },
29
+ methods: {
30
+ getContent() {
31
+ const html = this.$refs.textarea.innerHTML
32
+ return html.replace(/<div>/g, '<br>').replace(/<\/div>/g, '').replace(/<p>/g, '<br>').replace(/<\/p>/g, '')
33
+ }
34
+ }
35
+ }
36
+ </script>
37
+
38
+ <style scoped>
39
+ .text{
40
+ width: 100%;
41
+ border: 1px solid #ccc;
42
+ padding: 10px;
43
+ box-sizing: border-box;
44
+ }
45
+ </style>
package/src/index.js CHANGED
@@ -21,6 +21,7 @@ import editor2 from './components/editor2/index';
21
21
  import dragPopup from './components/dragPopup/index';
22
22
  import bizTaskInfo from './components/biz_taskInfo/index';
23
23
  import read from './components/read/index';
24
+ import textarea from './components/textarea/index';
24
25
 
25
26
  const components = [
26
27
  Calendar,
@@ -43,7 +44,8 @@ const components = [
43
44
  editor2,
44
45
  dragPopup,
45
46
  bizTaskInfo,
46
- read
47
+ read,
48
+ textarea
47
49
  ];
48
50
 
49
51
  function install(app) {
@@ -55,7 +57,7 @@ function install(app) {
55
57
  }
56
58
 
57
59
  export default {
58
- version: '1.18.85',
60
+ version: '1.19.86',
59
61
  install,
60
62
  Calendar,
61
63
  Message,
@@ -79,6 +81,7 @@ export default {
79
81
  editor2,
80
82
  dragPopup,
81
83
  bizTaskInfo,
82
- read
84
+ read,
85
+ textarea
83
86
  };
84
87