@tongfun/tf-widget 0.1.7 → 0.1.11

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.
Files changed (78) hide show
  1. package/.browserslistrc +3 -3
  2. package/.editorconfig +5 -5
  3. package/.eslintrc.js +17 -17
  4. package/README.md +39 -8
  5. package/dist/css/chunk-9c7a8e06.920744ef.css +1 -0
  6. package/dist/css/chunk-vendors.de967301.css +1 -0
  7. package/dist/css/index.153bd82e.css +1 -0
  8. package/dist/fonts/element-icons.535877f5.woff +0 -0
  9. package/dist/fonts/element-icons.732389de.ttf +0 -0
  10. package/dist/js/chunk-9c7a8e06.ffff58b5.js +1 -0
  11. package/dist/js/chunk-vendors.45086d09.js +39 -0
  12. package/dist/js/index.52bcef0d.js +1 -0
  13. package/lib/css/1.920744ef.css +1 -0
  14. package/lib/tf-widget.common.1.js +395 -0
  15. package/lib/tf-widget.common.js +88426 -63173
  16. package/lib/tf-widget.css +1 -1
  17. package/lib/tf-widget.umd.1.js +395 -0
  18. package/lib/tf-widget.umd.js +88425 -63172
  19. package/lib/tf-widget.umd.min.1.js +1 -0
  20. package/lib/tf-widget.umd.min.js +19 -3
  21. package/package/t-data-list/index.js +6 -0
  22. package/package/t-data-list/main.vue +192 -0
  23. package/package/t-data-list/src/condition-input/basic.vue +31 -0
  24. package/package/t-data-list/src/condition-input/date.vue +106 -0
  25. package/package/t-data-list/src/condition-input/index.vue +100 -0
  26. package/package/t-data-list/src/condition-input/input.vue +31 -0
  27. package/package/t-data-list/src/condition-input/number.vue +115 -0
  28. package/package/t-data-list/src/condition-input/select.vue +86 -0
  29. package/package/t-data-list/src/js/fieldTypeEnum.js +10 -0
  30. package/package/t-data-list/src/js/operatorEnum.js +109 -0
  31. package/package/t-data-list/src/js/qureyParamsEnum.js +4 -0
  32. package/package/t-data-list/src/js/util.js +34 -0
  33. package/package/t-data-list/src/mixins/button-controll-mixin.js +77 -0
  34. package/package/t-data-list/src/pushdown/push-down.vue +158 -0
  35. package/package/t-data-list/src/t-list-search.vue +32 -0
  36. package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -0
  37. package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -0
  38. package/package/t-data-list/src/t-plan/index.vue +190 -0
  39. package/package/t-data-list/src/t-plan/plan-content.vue +396 -0
  40. package/package/t-data-list/src/t-table/index.vue +120 -0
  41. package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -0
  42. package/package/t-data-list/src/t-table/table-group-item.vue +87 -0
  43. package/package/t-data-list/src/t-table/table-group.vue +179 -0
  44. package/package/t-data-list/src/t-table/table-records-header-popover.vue +250 -0
  45. package/package/t-data-list/src/t-table/table-records-selected.vue +159 -0
  46. package/package/t-data-list/src/t-table/table-records.vue +324 -0
  47. package/package/t-input/children/address.vue +101 -0
  48. package/package/t-input/children/basic-display.vue +41 -0
  49. package/package/t-input/children/basic.vue +251 -0
  50. package/package/t-input/children/date.vue +89 -0
  51. package/package/t-input/children/group-components/group-dialog.vue +350 -0
  52. package/package/t-input/children/group.vue +126 -0
  53. package/package/t-input/children/input.vue +72 -0
  54. package/package/t-input/children/number.vue +74 -0
  55. package/package/t-input/children/select.vue +89 -0
  56. package/package/t-input/children/tfile/fiile-enclosure.vue +233 -0
  57. package/package/t-input/children/tfile/file-img/comp.png +0 -0
  58. package/package/t-input/children/tfile/file-img/excel.png +0 -0
  59. package/package/t-input/children/tfile/file-img/img.png +0 -0
  60. package/package/t-input/children/tfile/file-img/pdf.png +0 -0
  61. package/package/t-input/children/tfile/file-img/word.png +0 -0
  62. package/package/t-input/index.js +7 -0
  63. package/package/t-input/index.vue +337 -0
  64. package/package/t-input/tInputCache.js +24 -0
  65. package/package/tf-layout/README.md +115 -0
  66. package/package/tf-layout/index.js +8 -0
  67. package/package/tf-layout/src/components/tf-labelbar.vue +378 -0
  68. package/package/tf-layout/src/components/tf-menu.vue +180 -0
  69. package/package/tf-layout/src/components/tf-right-menu.vue +89 -0
  70. package/package/tf-layout/src/components/tf-rotate-box.vue +50 -0
  71. package/package/tf-layout/src/tf-layout.vue +115 -0
  72. package/package.json +4 -2
  73. package/postinstall.js +10 -10
  74. package/src/api/file-enclosure.js +26 -0
  75. package/src/api/push-down.js +19 -0
  76. package/src/api/tableV3.js +186 -0
  77. package/src/index.js +11 -3
  78. package/src/mixins/t-data-query-mixin.js +289 -0
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <div
3
+ v-show="showMenu"
4
+ class="tf-right-menu"
5
+ :style="{ top: top + 'px', left: left + 'px' }"
6
+ >
7
+ <p @click="rightMenuClick('closeLeft')">
8
+ <i class="el-icon-back" /> 关闭左侧
9
+ </p>
10
+ <p @click="rightMenuClick('closeRight')">
11
+ <i class="el-icon-right" /> 关闭右侧
12
+ </p>
13
+ <p @click="rightMenuClick('closeOther')">
14
+ <i class="el-icon-circle-close" /> 关闭其他
15
+ </p>
16
+ <p @click="rightMenuClick('closeAll')">
17
+ <i class="el-icon-circle-close" /> 全部关闭
18
+ </p>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ props: {
25
+ top: {
26
+ default: 0,
27
+ type: Number
28
+ },
29
+ left: {
30
+ default: 0,
31
+ type: Number
32
+ },
33
+ showMenu: {
34
+ type: Boolean,
35
+ default: false
36
+ }
37
+ },
38
+ methods: {
39
+ /**
40
+ * @description 右键点击事件
41
+ */
42
+ rightMenuClick (params) {
43
+ this.$emit('rightMenuClick', params)
44
+ }
45
+ }
46
+ }
47
+ </script>
48
+
49
+ <style lang="less" scoped>
50
+ .tf-right-menu {
51
+ position: fixed;
52
+ z-index: 9999;
53
+ width: 120px;
54
+ height: 166px;
55
+ background: white;
56
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
57
+ border-radius: 4px;
58
+ box-sizing: border-box;
59
+ padding: 10px 0;
60
+ p {
61
+ cursor: pointer;
62
+ height: 36px;
63
+ margin: 0;
64
+ font-size: 14px;
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: space-between;
68
+ box-sizing: border-box;
69
+ padding: 0 20px;
70
+ color: #606266;
71
+ &:hover {
72
+ background: #ecf5ff;
73
+ color: #46a6ff;
74
+ }
75
+ }
76
+ &::before {
77
+ content: "";
78
+ position: absolute;
79
+ width: 12px;
80
+ height: 6px;
81
+ top: -6px;
82
+ right: 10px;
83
+ background: white;
84
+ clip-path: polygon(50% 0px, 100% 100%, 0px 100%);
85
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
86
+ border-radius: 1px;
87
+ }
88
+ }
89
+ </style>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div class="tf-rotate-box">
3
+ <span class="close">
4
+ <i />
5
+ <i />
6
+ <i />
7
+ <i />
8
+ </span>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {}
14
+ </script>
15
+
16
+ <style lang="less" scoped>
17
+ .tf-rotate-box {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ .close {
22
+ width: 14px;
23
+ height: 14px;
24
+ display: flex;
25
+ flex-wrap: wrap;
26
+ align-items: center;
27
+ justify-content: center;
28
+ gap: 2px 2px;
29
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s,
30
+ color 0.1s, font-size 0s;
31
+ &:hover {
32
+ transform: rotate(90deg);
33
+ transform-origin: 50% 50%;
34
+ i {
35
+ background: #07579a;
36
+ &:nth-child(1) {
37
+ transform: rotate(45deg);
38
+ transform-origin: 50% 50%;
39
+ }
40
+ }
41
+ }
42
+ i {
43
+ margin: 0;
44
+ height: 6px;
45
+ width: 6px;
46
+ background: #9a9a9a;
47
+ }
48
+ }
49
+ }
50
+ </style>
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <div class="tf-layout">
3
+ <TfMenu
4
+ :menus-info="menusInfo"
5
+ :menu-state="menuState"
6
+ />
7
+ <div class="tf-layout-subject">
8
+ <TfLaberBar
9
+ @setCache="setCache"
10
+ @changeMenuState="changeMenuState"
11
+ @deleteCache="deleteCache"
12
+ />
13
+ <div class="tf-layout-subject-content">
14
+ <keep-alive :include="secondCacheArray">
15
+ <router-view />
16
+ </keep-alive>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import TfMenu from './components/tf-menu'
24
+ import TfLaberBar from './components/tf-labelbar'
25
+ export default {
26
+ name: 'TfLayout',
27
+ components: {
28
+ TfMenu,
29
+ TfLaberBar
30
+ },
31
+ props: {
32
+ menusInfo: {
33
+ type: Array,
34
+ default: function () {
35
+ return []
36
+ }
37
+ }
38
+ },
39
+ data () {
40
+ return {
41
+ menuState: false,
42
+ cacheMap: new Map(),
43
+ secondCacheArray: [],
44
+ thirdCacheArr: []
45
+ }
46
+ },
47
+ methods: {
48
+ changeMenuState(state) {
49
+ this.menuState = state
50
+ },
51
+ setCache (value) {
52
+ this.cacheMap.set(value[2] || value[1], value[1])
53
+ this.initCacheArr()
54
+ },
55
+ initCacheArr () {
56
+ this.secondCacheArray.push(
57
+ ...this.arrayDiff([...this.cacheMap.values()], this.secondCacheArray)
58
+ )
59
+ this.thirdCacheArr.push(
60
+ ...this.arrayDiff([...this.cacheMap.keys()], this.thirdCacheArr)
61
+ )
62
+ this.$emit('setSecondCache', this.secondCacheArray)
63
+ this.$emit('setThirdCache', this.thirdCacheArr)
64
+ },
65
+ arrayDiff (arr, arrRaw) {
66
+ if (Array.isArray(arr)) {
67
+ return arr.filter((i) => {
68
+ return arrRaw.indexOf(i) < 0
69
+ })
70
+ }
71
+ return []
72
+ },
73
+ deleteCache (value) {
74
+ if (Array.isArray(value)) {
75
+ value.forEach((item) => {
76
+ this.cacheMap.delete(item[2] || item[1])
77
+ this.thirdCacheArr.splice(
78
+ this.thirdCacheArr.indexOf(item[2] || item[1]),
79
+ 1
80
+ )
81
+ if ([...this.cacheMap.values()].indexOf(item[1]) === -1) {
82
+ this.secondCacheArray.splice(
83
+ this.secondCacheArray.indexOf(item[2]),
84
+ 1
85
+ )
86
+ }
87
+ })
88
+ this.$emit('setSecondCache', this.secondCacheArray)
89
+ this.$emit('setThirdCache', this.thirdCacheArr)
90
+ }
91
+ }
92
+ }
93
+ }
94
+ </script>
95
+
96
+ <style lang="less" scoped>
97
+ .tf-layout {
98
+ height: 100vh;
99
+ width: 100vw;
100
+ display: flex;
101
+ .tf-layout-subject {
102
+ flex: 1;
103
+ height: 94.82vh;
104
+ width: 100%;
105
+ overflow: hidden;
106
+ .tf-layout-subject-content {
107
+ width: 100%;
108
+ height: calc(100% - 35px);
109
+ background: rgb(241, 241, 241);
110
+ box-sizing: border-box;
111
+ padding: 5px 0 0 0;
112
+ }
113
+ }
114
+ }
115
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tongfun/tf-widget",
3
- "version": "0.1.7",
3
+ "version": "0.1.11",
4
4
  "description": "tf-widget",
5
5
  "main": "lib/tf-widget.umd.js",
6
6
  "private": false,
@@ -20,8 +20,10 @@
20
20
  "js-base64": "^3.6.0",
21
21
  "less": "^4.1.0",
22
22
  "less-loader": "^7.2.1",
23
+ "sortablejs": "^1.13.0",
23
24
  "vue": "^2.6.11",
24
- "sortablejs": "^1.13.0"
25
+ "vue2-datepicker": "^3.10.4",
26
+ "vuedraggable": "^2.24.3"
25
27
  },
26
28
  "devDependencies": {
27
29
  "@vue/cli-plugin-babel": "~4.5.0",
package/postinstall.js CHANGED
@@ -1,10 +1,10 @@
1
-
2
- const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
3
- '\u001B[96mWe need the best of you! Come and join us\n\n' +
4
- '\u001B[96mWe are waiting for you\n'
5
-
6
- function showBanner () {
7
- console.log(BANNER)
8
- }
9
-
10
- showBanner()
1
+
2
+ const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
3
+ '\u001B[96mWe need the best of you! Come and join us\n\n' +
4
+ '\u001B[96mWe are waiting for you\n'
5
+
6
+ function showBanner () {
7
+ console.log(BANNER)
8
+ }
9
+
10
+ showBanner()
@@ -0,0 +1,26 @@
1
+ import request from '@/utils/request.js'
2
+
3
+ /**
4
+ * 删除附件
5
+ * @param {id} 删除附件的id
6
+ */
7
+ export function delAttachment (id) {
8
+ return request({
9
+ url: `/api/file/attachment/?ids[]=${id}`,
10
+ method: 'delete'
11
+ })
12
+ }
13
+
14
+ /**
15
+ * 下载附件
16
+ * @param {id} 下载附件的id
17
+ */
18
+
19
+ // 根据id下载附件
20
+ export function download (id) {
21
+ return request({
22
+ url: `/api/file/attachment/download/${id}`,
23
+ method: 'get',
24
+ responseType: 'arraybuffer'
25
+ })
26
+ }
@@ -0,0 +1,19 @@
1
+ import request from '@/utils/request'
2
+
3
+ // 查询所有下推的单据
4
+ export function findBillExchangeRouterVO (params) {
5
+ return request({
6
+ url: '/api/report/billExchange/findBillExchangeRouterVO',
7
+ method: 'get',
8
+ params
9
+ })
10
+ }
11
+
12
+ // 下推时获取数据
13
+ export function getDataWhenAdd (params) {
14
+ return request({
15
+ url: '/api/report/billExchange/doExchange',
16
+ method: 'Get',
17
+ params
18
+ })
19
+ }
@@ -0,0 +1,186 @@
1
+ import request from '@/utils/request.js'
2
+
3
+ /**
4
+ * 列表数据
5
+ */
6
+ // 获取列表的数据
7
+ export function getTableData (target, data, queryType) {
8
+ data.sceneSelector = queryType
9
+ return request({
10
+ url: `/api${target}/tList`,
11
+ method: 'post',
12
+ data
13
+ })
14
+ }
15
+
16
+ // 获取列表的合计
17
+ export function getTableSum (target, data) {
18
+ data.sceneSelector = 'LIST'
19
+ return request({
20
+ url: `/api${target}/tSum`,
21
+ method: 'post',
22
+ data
23
+ })
24
+ }
25
+
26
+ // 提交
27
+ export function submit (ids) {
28
+
29
+ }
30
+
31
+ // 撤销
32
+ export function unSubmit (ids) {
33
+
34
+ }
35
+
36
+ // 审批
37
+ export function audit (ids) {
38
+
39
+ }
40
+
41
+ // 反审核
42
+ export function unAudit (ids) {
43
+
44
+ }
45
+
46
+ // 删除数据
47
+ export function del ({ params, target }) {
48
+ return request({
49
+ url: `/api${target}/tDel`,
50
+ method: 'get',
51
+ params
52
+ })
53
+ }
54
+
55
+ // todo:导入导出
56
+
57
+ /**
58
+ * 方案
59
+ */
60
+ // 获取方案列表
61
+ export function getFilterPlan (target) {
62
+ return request({
63
+ url: `/api${target}/tSchemeQuery`,
64
+ method: 'get'
65
+ })
66
+ }
67
+
68
+ // 添加一个新的方案
69
+ export function addPlan (target, data) {
70
+ return request({
71
+ url: `/api${target}/tSchemeSave`,
72
+ method: 'post',
73
+ data: {
74
+ commonUserQuerySchemeContentSaveDTOS: data.conditionMulti,
75
+ commonUserQuerySchemeUsefulSaveDTOS: data.conditionAlways,
76
+ commonUserQuerySchemeSaveDTO: data.planMsg
77
+ }
78
+ })
79
+ }
80
+
81
+ // 删除一个方案
82
+ // todo:如果删除的是一个默认方案怎么办,还是说前端直接默认方案不允许删除
83
+ export function deletePlan (target, planId) {
84
+ return request({
85
+ url: `/api${target}/tSchemeDelete`,
86
+ method: 'post',
87
+ data: [planId]
88
+ })
89
+ }
90
+
91
+ // 修改一个方案
92
+ export function updatePlan (target, data) {
93
+ return request({
94
+ url: `/api${target}/tSchemeUpdate`,
95
+ method: 'post',
96
+ data: {
97
+ userQuerySchemeContentUpdateDTOS: data.conditionMulti,
98
+ userQuerySchemeUsefulUpdateDTOS: data.conditionAlways,
99
+ userQuerySchemeUpdateDTO: data.planMsg
100
+ }
101
+ })
102
+ }
103
+
104
+ // 获取方案中枚举的字段的选项
105
+ export function getEnumOptions (target, field) {
106
+ return request({
107
+ url: `/api${target}/tEnum`,
108
+ method: 'get',
109
+ params: {
110
+ field
111
+ }
112
+ })
113
+ }
114
+
115
+ /**
116
+ * 列表布局(方案高级条件的字段
117
+ */
118
+ // 获取表格布局
119
+ export function getTableLayout (target) {
120
+ return request({
121
+ url: `/api${target}/tListHeader`,
122
+ method: 'get'
123
+ })
124
+ }
125
+ // 修改布局
126
+ export function updateTalbeLayout (data) {
127
+
128
+ }
129
+
130
+ /**
131
+ * 列表的分组查询
132
+ */
133
+ export function getGroupTree (target) {
134
+ return request({
135
+ url: `/api${target}/tGroupQuery`,
136
+ method: 'get'
137
+ })
138
+ }
139
+
140
+ // 添加一个分组节点
141
+ export function addGroupNode (target, name, id, pid, groupCode) {
142
+ return request({
143
+ url: `/api${target}/tGroupInsert`,
144
+ method: 'post',
145
+ data: {
146
+ name,
147
+ id: null,
148
+ pid,
149
+ groupCode
150
+ }
151
+ })
152
+ }
153
+
154
+ // 删除一个分组节点
155
+ export function removeGroupNode (target, id) {
156
+ return request({
157
+ url: `/api${target}/tGroupDelete`,
158
+ method: 'post',
159
+ data: { id }
160
+ })
161
+ }
162
+
163
+ // 修改一个分组节点
164
+ export function updateGroupNode (target, name, id, pid, groupCode) {
165
+ return request({
166
+ url: `/api${target}/tGroupUpdate`,
167
+ method: 'post',
168
+ data: {
169
+ name,
170
+ id,
171
+ pid,
172
+ groupCode
173
+ }
174
+ })
175
+ }
176
+
177
+ export function pushDownValid (name, ids) {
178
+ return request({
179
+ url: '/api/report/billExchange/preHandle',
180
+ method: 'post',
181
+ data: {
182
+ name,
183
+ ids
184
+ }
185
+ })
186
+ }
package/src/index.js CHANGED
@@ -1,10 +1,15 @@
1
1
 
2
2
  import TfWidget from '../package/tf-widget'
3
3
  import SvgIcon from '../package/svg-icon'
4
-
4
+ import TfLayout from '../package/tf-layout'
5
+ import TDataList from '../package/t-data-list'
6
+ import Tinput from '../package/t-input'
5
7
  const components = [
6
8
  TfWidget,
7
- SvgIcon
9
+ SvgIcon,
10
+ TfLayout,
11
+ TDataList,
12
+ Tinput
8
13
  ]
9
14
 
10
15
  const install = function (Vue) {
@@ -16,5 +21,8 @@ const install = function (Vue) {
16
21
  export default {
17
22
  install,
18
23
  TfWidget,
19
- SvgIcon
24
+ SvgIcon,
25
+ TfLayout,
26
+ TDataList,
27
+ Tinput
20
28
  }