eoss-ui 0.8.45 → 0.8.47

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": "eoss-ui",
3
- "version": "0.8.45",
3
+ "version": "0.8.47",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -1,110 +1,112 @@
1
- <template>
2
- <div
3
- class="flow-sort-box"
4
- style="height: 100%;overflow-y: auto;"
5
- v-loading="loading"
6
- element-loading-text="加载中..."
7
- element-loading-spinner="el-icon-loading"
8
- element-loading-background="rgba(255, 255,255, 0.8)">
9
- <Draggable
10
- class="flow-sort-draggable"
11
- :list="sortList"
12
- >
13
- <es-button style="margin-top: 10px;" v-for="item in sortList" :key="item.id" plain>{{
14
- item.name
15
- }}</es-button></Draggable
16
- >
17
- <div class="flow-sort-btn">
18
- <es-button type="primary" @click="saveSort(true)">保存</es-button>
19
- <es-button @click="saveSort(false)">取消</es-button>
20
- </div>
21
- </div>
22
- </template>
23
-
24
- <script>
25
- import util from 'eoss-ui/src/utils/util';
26
- import Draggable from 'vuedraggable';
27
- import { toDefinitionChangeSort,setSort } from 'eoss-ui/src/config/api';
28
- export default {
29
- name: 'SortFlow',
30
- components: {
31
- Draggable
32
- },
33
- props: {
34
- flowTypeCode: {
35
- type: String,
36
- default: ''
37
- },
38
- defaultProcessKey: {
39
- type: String,
40
- default: ''
41
- }
42
- },
43
- data() {
44
- return {
45
- sortList: [],
46
- loading:false
47
- };
48
- },
49
- mounted() {
50
- this.getSortInfo();
51
- },
52
- methods: {
53
- saveSort(type){
54
- if(type){
55
- let arr = [];
56
- this.sortList.map((item,index)=>{
57
- arr.push({
58
- id:item.id,
59
- processDefId:item.processDefId,
60
- sort:this.sortList.length - index
61
- })
62
- });
63
- const params = {
64
- url: setSort,
65
- method: 'post',
66
- format: false,
67
- headers: {
68
- Accept: 'application/json,text/plain',
69
- 'Content-Type': 'application/json;charset=UTF-8'
70
- },
71
- data: arr
72
- };
73
- this.loading=true;
74
- util.ajax(params).then((res) => {
75
- this.loading=false;
76
- if (res.rCode === 0 || res.status=== 'success') {
77
- this.$message.success('保存成功');
78
- this.$emit('success',this.sortList)
79
- }
80
- }).catch(() => {
81
- this.loading=false;
82
- });
83
- }else{
84
- this.$emit('close')
85
- }
86
- },
87
- getSortInfo() {
88
- const params = {
89
- url: toDefinitionChangeSort,
90
- method: 'get',
91
- params: {
92
- flowTypeCode: this.flowTypeCode,
93
- defaultProcessKey: this.defaultProcessKey
94
- }
95
- };
96
- this.loading=true;
97
- util.ajax(params).then((res) => {
98
- this.loading=false;
99
- if (res.rCode === 0) {
100
- this.sortList = res.results.definitionList || [];
101
- }
102
- }).catch(() => {
103
- this.loading=false;
104
- });
105
- }
106
- }
107
- };
108
- </script>
109
-
110
- <style></style>
1
+ <template>
2
+ <div
3
+ class="flow-sort-box"
4
+ style="height: 100%;overflow-y: auto;"
5
+ v-loading="loading"
6
+ element-loading-text="加载中..."
7
+ element-loading-spinner="el-icon-loading"
8
+ element-loading-background="rgba(255, 255,255, 0.8)">
9
+ <Draggable
10
+ class="flow-sort-draggable"
11
+ :list="sortList"
12
+ >
13
+ <es-button style="margin-top: 10px;" v-for="item in sortList" :key="item.id" plain>{{
14
+ item.name
15
+ }}</es-button></Draggable
16
+ >
17
+ <div class="flow-sort-btn">
18
+ <es-button type="primary" @click="saveSort(true)">保存</es-button>
19
+ <es-button @click="saveSort(false)">取消</es-button>
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import util from 'eoss-ui/src/utils/util';
26
+ import Draggable from 'vuedraggable';
27
+ import { toDefinitionChangeSort,setSort } from 'eoss-ui/src/config/api';
28
+ export default {
29
+ name: 'SortFlow',
30
+ components: {
31
+ Draggable
32
+ },
33
+ props: {
34
+ flowTypeCode: {
35
+ type: String,
36
+ default: ''
37
+ },
38
+ ownerType:{type:String, default: ''},
39
+ defaultProcessKey: {
40
+ type: String,
41
+ default: ''
42
+ }
43
+ },
44
+ data() {
45
+ return {
46
+ sortList: [],
47
+ loading:false
48
+ };
49
+ },
50
+ mounted() {
51
+ this.getSortInfo();
52
+ },
53
+ methods: {
54
+ saveSort(type){
55
+ if(type){
56
+ let arr = [];
57
+ this.sortList.map((item,index)=>{
58
+ arr.push({
59
+ id:item.id,
60
+ processDefId:item.processDefId,
61
+ sort:this.sortList.length - index
62
+ })
63
+ });
64
+ const params = {
65
+ url: setSort,
66
+ method: 'post',
67
+ format: false,
68
+ headers: {
69
+ Accept: 'application/json,text/plain',
70
+ 'Content-Type': 'application/json;charset=UTF-8'
71
+ },
72
+ data: arr
73
+ };
74
+ this.loading=true;
75
+ util.ajax(params).then((res) => {
76
+ this.loading=false;
77
+ if (res.rCode === 0 || res.status=== 'success') {
78
+ this.$message.success('保存成功');
79
+ this.$emit('success',this.sortList)
80
+ }
81
+ }).catch(() => {
82
+ this.loading=false;
83
+ });
84
+ }else{
85
+ this.$emit('close')
86
+ }
87
+ },
88
+ getSortInfo() {
89
+ const params = {
90
+ url: toDefinitionChangeSort,
91
+ method: 'get',
92
+ params: {
93
+ flowTypeCode: this.flowTypeCode,
94
+ defaultProcessKey: this.defaultProcessKey,
95
+ ownerType:this.ownerType
96
+ }
97
+ };
98
+ this.loading=true;
99
+ util.ajax(params).then((res) => {
100
+ this.loading=false;
101
+ if (res.rCode === 0) {
102
+ this.sortList = res.results.definitionList || [];
103
+ }
104
+ }).catch(() => {
105
+ this.loading=false;
106
+ });
107
+ }
108
+ }
109
+ };
110
+ </script>
111
+
112
+ <style></style>