widget.qw 1.0.82 → 1.0.84

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 (105) hide show
  1. package/.env.development +10 -10
  2. package/.env.production +8 -8
  3. package/README.md +75 -75
  4. package/build/style.css +471 -471
  5. package/build/widget.qw.es.js +132 -65
  6. package/build/widget.qw.umd.js +132 -65
  7. package/index.html +17 -17
  8. package/package.json +47 -47
  9. package/src/App.vue +26 -26
  10. package/src/api/index.js +165 -165
  11. package/src/components/AuditBar.vue +396 -396
  12. package/src/components/BillCard.vue +164 -164
  13. package/src/components/CascaderPicker.vue +132 -132
  14. package/src/components/CascaderPop.vue +373 -371
  15. package/src/components/CheckGroup.vue +113 -113
  16. package/src/components/DatetimeDropdown.vue +62 -0
  17. package/src/components/{DatetimePicker/index.vue → DatetimePicker.vue} +124 -124
  18. package/src/components/DayDropdown.vue +56 -56
  19. package/src/components/FilePicker.vue +169 -169
  20. package/src/components/Input.vue +80 -80
  21. package/src/components/MonthDropdown.vue +51 -51
  22. package/src/components/MultiPicker.vue +123 -123
  23. package/src/components/ObjsEditor.vue +334 -334
  24. package/src/components/SecretNotify.js +5 -5
  25. package/src/components/Sheet.vue +92 -92
  26. package/src/components/SingleApiPicker.vue +108 -108
  27. package/src/components/SinglePicker.vue +102 -102
  28. package/src/components/SingleUserSelector.vue +425 -425
  29. package/src/components/Switch.vue +64 -64
  30. package/src/components/TreePicker.vue +113 -113
  31. package/src/components/UserPicker.vue +106 -106
  32. package/src/components/UserProfile.vue +129 -129
  33. package/src/components/UsersPicker.vue +118 -118
  34. package/src/components/YearDropdown.vue +59 -59
  35. package/src/components/data_selector.vue +303 -303
  36. package/src/components/image_picker.vue +123 -123
  37. package/src/components/images_picker.vue +195 -195
  38. package/src/components/index.js +167 -162
  39. package/src/components/mult_list_selector.vue +155 -155
  40. package/src/components/subdepartment_selector.vue +481 -481
  41. package/src/components/user_selector.vue +639 -639
  42. package/src/components/widget/DataPop.vue +95 -95
  43. package/src/components/{DatetimePicker → widget}/DatetimePop.vue +342 -342
  44. package/src/components/widget/TreePop.vue +88 -88
  45. package/src/components/widget/UserPop.vue +347 -347
  46. package/src/main.js +117 -117
  47. package/src/router/index.ts +178 -173
  48. package/src/util/array_util.js +32 -32
  49. package/src/util/auth_util.js +72 -72
  50. package/src/util/bool_util.js +5 -5
  51. package/src/util/bus.js +1 -1
  52. package/src/util/cache_util.js +18 -18
  53. package/src/util/errer_code.js +6 -6
  54. package/src/util/eval_util.js +19 -19
  55. package/src/util/icon_util.js +36 -36
  56. package/src/util/image_util.js +27 -27
  57. package/src/util/index.js +57 -57
  58. package/src/util/num_util.js +70 -70
  59. package/src/util/obj_util.js +28 -28
  60. package/src/util/request.js +73 -73
  61. package/src/util/request_json.js +71 -71
  62. package/src/util/request_json_mute.js +65 -65
  63. package/src/util/request_upload.js +79 -79
  64. package/src/util/route_util.js +31 -31
  65. package/src/util/str_util.js +143 -143
  66. package/src/util/time_util.js +406 -406
  67. package/src/util/toast_util.js +24 -24
  68. package/src/util/tree_util.js +153 -153
  69. package/src/util/uuid_util.js +9 -9
  70. package/src/util/validate.js +182 -182
  71. package/src/util/vue_filter.js +223 -223
  72. package/src/views/auditbar/index.vue +78 -78
  73. package/src/views/billcard/index.vue +48 -48
  74. package/src/views/cascaderpicker/index.vue +0 -0
  75. package/src/views/cascaderpop/index.vue +90 -90
  76. package/src/views/checkgroup/index.vue +35 -35
  77. package/src/views/dataSelector/index.vue +48 -48
  78. package/src/views/datetimedropdown/index.vue +34 -0
  79. package/src/views/datetimepicker/index.vue +34 -34
  80. package/src/views/daydropdown/index.vue +31 -31
  81. package/src/views/filepicker/index.vue +32 -32
  82. package/src/views/home/index.vue +0 -0
  83. package/src/views/imagepicker/index.vue +31 -31
  84. package/src/views/imagespicker/index.vue +37 -37
  85. package/src/views/input/index.vue +35 -35
  86. package/src/views/monthdropdown/index.vue +31 -31
  87. package/src/views/multListSelector/index.vue +61 -61
  88. package/src/views/multipicker/index.vue +36 -36
  89. package/src/views/objseditor/index.vue +277 -277
  90. package/src/views/productSelector/index.vue +35 -35
  91. package/src/views/projectpicker/index.vue +41 -41
  92. package/src/views/secretnotify/index.vue +27 -27
  93. package/src/views/sheet/index.vue +45 -45
  94. package/src/views/singlepicker/index.vue +35 -35
  95. package/src/views/subdepartmentSelector/index.vue +40 -40
  96. package/src/views/switch/index.vue +34 -34
  97. package/src/views/treepicker/index.vue +41 -41
  98. package/src/views/userSelector/index.vue +54 -54
  99. package/src/views/userSelectorNew/index.vue +45 -45
  100. package/src/views/userpicker/index.vue +43 -43
  101. package/src/views/userprofile/index.vue +30 -30
  102. package/src/views/userspicker/index.vue +43 -43
  103. package/src/views/yeardropdown/index.vue +32 -32
  104. package/src/vm/index.js +1 -1
  105. package/vite.config.ts +122 -122
@@ -1,165 +1,165 @@
1
- <template>
2
- <div class="widget">
3
- <van-cell-group inset class="card-box">
4
- <div class="card-header">
5
- <div class="card-sum">
6
- <div class="card-type">{{ props.category }}</div>
7
- <div class="card-no">{{ props.no }}</div>
8
- </div>
9
- <van-tag class="user-state" size="large" :color="userState2color(props.userState)">{{
10
- userState2title(props.userState)
11
- }}</van-tag>
12
- <van-tag class="process-state" mark plain size="large"
13
- :color="processState2color(props.processState)">{{
14
- processState2title(props.processState)
15
- }}</van-tag>
16
- </div>
17
-
18
- <van-cell :title="item.title" :value="item.value" :border="false" v-for="(item, i) in props.fields"
19
- :key="i" />
20
-
21
- <slot name="foot"></slot>
22
- </van-cell-group>
23
- </div>
24
- </template>
25
-
26
- <script setup>
27
- import { reactive, ref, onMounted, watch, computed } from "vue"
28
- import util from '@/util'
29
-
30
- const props = defineProps({
31
- // 单据类型
32
- category: {
33
- type: String,
34
- default: ''
35
- },
36
- // 单号
37
- no: {
38
- type: String,
39
- default: ''
40
- },
41
- // 流程状态
42
- processState: {
43
- type: String,
44
- default: ''
45
- },
46
- // 用户状态
47
- userState: {
48
- type: String,
49
- default: ''
50
- },
51
- // 摘要字段
52
- fields: {
53
- type: Array,
54
- default: []
55
- }
56
- })
57
- const data = reactive({
58
- })
59
-
60
- onMounted(() => {
61
-
62
- })
63
-
64
- const processState2color = (state) => {
65
- if (state == 'finish_pass') {
66
- return '#ACACAC'
67
- } else if (state == 'finish_refuse') {
68
- return '#ACACAC'
69
- } else if (state == 'started') {
70
- return '#338CDE'
71
- } else {
72
- return '#ACACAC'
73
- }
74
- }
75
-
76
- const processState2title = (state) => {
77
- if (state == 'finish_pass') {
78
- return '已完成'
79
- } else if (state == 'finish_refuse') {
80
- return '已撤销'
81
- } else if (state == 'started') {
82
- return '进行中'
83
- } else {
84
- return '未知'
85
- }
86
- }
87
-
88
- const userState2color = (state) => {
89
- if (state == 'unstart') {
90
- return '#9A9A9A'
91
- } else if (state == 'started') {
92
- return '#EE0A25'
93
- } else if (state == 'pass') {
94
- return '#07C062'
95
- } else if (state == 'refuse') {
96
- return '#EE0A25'
97
- } else {
98
- return '#9A9A9A'
99
- }
100
- }
101
-
102
- const userState2title = (state) => {
103
- if (state == 'unstart') {
104
- return '未启动'
105
- } else if (state == 'started') {
106
- return '待审核'
107
- } else if (state == 'pass') {
108
- return '已审核'
109
- } else if (state == 'refuse') {
110
- return '已驳回'
111
- } else {
112
- return '未知'
113
- }
114
- }
115
- </script>
116
-
117
- <style lang='scss' scoped>
118
- .widget {
119
- background-color: white;
120
- border-radius: 8px;
121
- box-shadow: var(--van-dropdown-menu-shadow);
122
- color: 14px;
123
-
124
- .card-box {
125
- padding-bottom: 8px;
126
-
127
- .card-header {
128
- display: flex;
129
- align-items: center;
130
- justify-content: space-between;
131
- padding: 15px 10px;
132
- border-bottom: 1px solid #eee;
133
-
134
- .card-sum {
135
- flex: 1;
136
- font-size: 14px;
137
- text-align: left;
138
- }
139
-
140
- .user-state {
141
- margin-right: 1px;
142
- }
143
- }
144
- }
145
- }
146
-
147
- :deep(.van-cell__value) {
148
- flex: 2 !important;
149
- }
150
-
151
- :deep(.van-cell__title) {
152
- font-size: 12px !important;
153
- color: #666 !important;
154
- text-align: left !important;
155
- }
156
-
157
- :deep(.van-cell__value) {
158
- font-size: 12px !important;
159
- color: #888 !important;
160
- }
161
-
162
- :deep(.van-cell) {
163
- padding: 2px 10px !important;
164
- }
1
+ <template>
2
+ <div class="widget">
3
+ <van-cell-group inset class="card-box">
4
+ <div class="card-header">
5
+ <div class="card-sum">
6
+ <div class="card-type">{{ props.category }}</div>
7
+ <div class="card-no">{{ props.no }}</div>
8
+ </div>
9
+ <van-tag class="user-state" size="large" :color="userState2color(props.userState)">{{
10
+ userState2title(props.userState)
11
+ }}</van-tag>
12
+ <van-tag class="process-state" mark plain size="large"
13
+ :color="processState2color(props.processState)">{{
14
+ processState2title(props.processState)
15
+ }}</van-tag>
16
+ </div>
17
+
18
+ <van-cell :title="item.title" :value="item.value" :border="false" v-for="(item, i) in props.fields"
19
+ :key="i" />
20
+
21
+ <slot name="foot"></slot>
22
+ </van-cell-group>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup>
27
+ import { reactive, ref, onMounted, watch, computed } from "vue"
28
+ import util from '@/util'
29
+
30
+ const props = defineProps({
31
+ // 单据类型
32
+ category: {
33
+ type: String,
34
+ default: ''
35
+ },
36
+ // 单号
37
+ no: {
38
+ type: String,
39
+ default: ''
40
+ },
41
+ // 流程状态
42
+ processState: {
43
+ type: String,
44
+ default: ''
45
+ },
46
+ // 用户状态
47
+ userState: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ // 摘要字段
52
+ fields: {
53
+ type: Array,
54
+ default: []
55
+ }
56
+ })
57
+ const data = reactive({
58
+ })
59
+
60
+ onMounted(() => {
61
+
62
+ })
63
+
64
+ const processState2color = (state) => {
65
+ if (state == 'finish_pass') {
66
+ return '#ACACAC'
67
+ } else if (state == 'finish_refuse') {
68
+ return '#ACACAC'
69
+ } else if (state == 'started') {
70
+ return '#338CDE'
71
+ } else {
72
+ return '#ACACAC'
73
+ }
74
+ }
75
+
76
+ const processState2title = (state) => {
77
+ if (state == 'finish_pass') {
78
+ return '已完成'
79
+ } else if (state == 'finish_refuse') {
80
+ return '已撤销'
81
+ } else if (state == 'started') {
82
+ return '进行中'
83
+ } else {
84
+ return '未知'
85
+ }
86
+ }
87
+
88
+ const userState2color = (state) => {
89
+ if (state == 'unstart') {
90
+ return '#9A9A9A'
91
+ } else if (state == 'started') {
92
+ return '#EE0A25'
93
+ } else if (state == 'pass') {
94
+ return '#07C062'
95
+ } else if (state == 'refuse') {
96
+ return '#EE0A25'
97
+ } else {
98
+ return '#9A9A9A'
99
+ }
100
+ }
101
+
102
+ const userState2title = (state) => {
103
+ if (state == 'unstart') {
104
+ return '未启动'
105
+ } else if (state == 'started') {
106
+ return '待审核'
107
+ } else if (state == 'pass') {
108
+ return '已审核'
109
+ } else if (state == 'refuse') {
110
+ return '已驳回'
111
+ } else {
112
+ return '未知'
113
+ }
114
+ }
115
+ </script>
116
+
117
+ <style lang='scss' scoped>
118
+ .widget {
119
+ background-color: white;
120
+ border-radius: 8px;
121
+ box-shadow: var(--van-dropdown-menu-shadow);
122
+ color: 14px;
123
+
124
+ .card-box {
125
+ padding-bottom: 8px;
126
+
127
+ .card-header {
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: space-between;
131
+ padding: 15px 10px;
132
+ border-bottom: 1px solid #eee;
133
+
134
+ .card-sum {
135
+ flex: 1;
136
+ font-size: 14px;
137
+ text-align: left;
138
+ }
139
+
140
+ .user-state {
141
+ margin-right: 1px;
142
+ }
143
+ }
144
+ }
145
+ }
146
+
147
+ :deep(.van-cell__value) {
148
+ flex: 2 !important;
149
+ }
150
+
151
+ :deep(.van-cell__title) {
152
+ font-size: 12px !important;
153
+ color: #666 !important;
154
+ text-align: left !important;
155
+ }
156
+
157
+ :deep(.van-cell__value) {
158
+ font-size: 12px !important;
159
+ color: #888 !important;
160
+ }
161
+
162
+ :deep(.van-cell) {
163
+ padding: 2px 10px !important;
164
+ }
165
165
  </style>
@@ -1,133 +1,133 @@
1
- <template>
2
- <van-field v-if="!isGone" :label="props.label" readonly :required="isRequired" :rules="props.rules"
3
- :disabled="isDisabled" :placeholder="props.placeholder" :is-link="isReadonly ? false : true"
4
- @click="data.isShowPop = !isReadonly" label-class="label">
5
- <template #input v-if="modelValue">
6
- <div style="display: flex; align-items: center; flex-wrap: wrap;">
7
- <van-tag class="selected-node" v-if="!props.multiple" :closeable="!isDisabled" color="#fff"
8
- text-color="#333" size="medium" @close.stop="onDelete">
9
- {{ data.selectedNodes[0]?.path }}
10
- </van-tag>
11
- <van-tag class="selected-node" v-if="props.multiple" v-for="(item, i) in data.selectedNodes" :key="i"
12
- :closeable="!isDisabled" color="#fff" text-color="#333" size="medium" @close.stop="onDelete(i)">
13
- {{ item.path }}
14
- </van-tag>
15
- </div>
16
- </template>
17
- </van-field>
18
-
19
- <CascaderPop v-model:show="data.isShowPop" v-model="data.selectedNodeId" :placeholder="props.placeholder"
20
- @select="onSelect" :keywordQueryNode="props.keywordQueryNode" :idQueryNode="props.idQueryNode" />
21
- </template>
22
-
23
- <script setup>
24
- import { reactive, onMounted, watch } from "vue";
25
- import util from "@/util"
26
- import { useVModel } from '@vueuse/core'
27
- import CascaderPop from './CascaderPop.vue'
28
-
29
- const props = defineProps({
30
- modelValue: {
31
- type: [String, Array, Number],
32
- default: null,
33
- },
34
- multiple: {
35
- type: Boolean,
36
- default: false
37
- },
38
- label: {
39
- type: String,
40
- default: "",
41
- },
42
- placeholder: {
43
- type: String,
44
- default: "",
45
- },
46
- required: {
47
- type: Boolean,
48
- default: false,
49
- },
50
- readonly: {
51
- type: Boolean,
52
- default: true,
53
- },
54
- rules: {
55
- type: Array,
56
- default: [],
57
- },
58
- auth: {
59
- type: String,
60
- default: "",
61
- },
62
- keywordQueryNode: {
63
- type: Function,
64
- default: () => { }
65
- },
66
- idQueryNode: {
67
- type: Function,
68
- default: () => { }
69
- },
70
- });
71
-
72
- // 弹出层
73
- const data = reactive({
74
- isShowPop: false,
75
- selectedNodes: [],
76
- selectedNodeId: null
77
- })
78
-
79
- // 定义emit
80
- const emit = defineEmits(["update:modelValue", "select"]);
81
- const modelValue = useVModel(props, 'modelValue', emit)
82
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
83
-
84
- //首页加载
85
- onMounted(() => {
86
- })
87
-
88
- const onSelect = (node) => {
89
- if (!props.multiple) {
90
- data.selectedNodes = [node]
91
- emit('select', data.selectedNodes[0])
92
- modelValue.value = node.id
93
- }
94
- else {
95
- let one = data.selectedNodes.find(item => item.id === node.id)
96
- if (!one)
97
- data.selectedNodes = [...data.selectedNodes, node]
98
- emit('select', data.selectedNodes)
99
- modelValue.value = data.selectedNodes.map(item => item.id)
100
- }
101
- }
102
-
103
- const onDelete = (idx) => {
104
- if (!props.multiple) {
105
- modelValue.value = null
106
- } else {
107
- modelValue.value.splice(idx, 1)
108
- }
109
- }
110
-
111
- watch(() => JSON.stringify(modelValue.value), async (n, o) => {
112
- if (!props.multiple) {
113
- data.selectedNodeId = modelValue.value
114
- } else {
115
- data.selectedNodes = []
116
- let ids = modelValue.value || []
117
- ids.forEach(async (id) => {
118
- let params = {}
119
- params.id = id
120
- params.isReturnParent = false
121
- params.hasChildren = false
122
- params.hasPaths= true
123
- await props.idQueryNode(params, (node) => {
124
- data.selectedNodes = [...data.selectedNodes, node]
125
- })
126
- })
127
- }
128
- }, {
129
- immediate: true
130
- })
131
- </script>
132
-
1
+ <template>
2
+ <van-field v-if="!isGone" :label="props.label" readonly :required="isRequired" :rules="props.rules"
3
+ :disabled="isDisabled" :placeholder="props.placeholder" :is-link="isReadonly ? false : true"
4
+ @click="data.isShowPop = !isReadonly" label-class="label">
5
+ <template #input v-if="modelValue">
6
+ <div style="display: flex; align-items: center; flex-wrap: wrap;">
7
+ <van-tag class="selected-node" v-if="!props.multiple" :closeable="!isDisabled" color="#fff"
8
+ text-color="#333" size="medium" @close.stop="onDelete">
9
+ {{ data.selectedNodes[0]?.path }}
10
+ </van-tag>
11
+ <van-tag class="selected-node" v-if="props.multiple" v-for="(item, i) in data.selectedNodes" :key="i"
12
+ :closeable="!isDisabled" color="#fff" text-color="#333" size="medium" @close.stop="onDelete(i)">
13
+ {{ item.path }}
14
+ </van-tag>
15
+ </div>
16
+ </template>
17
+ </van-field>
18
+
19
+ <CascaderPop v-model:show="data.isShowPop" v-model="data.selectedNodeId" :placeholder="props.placeholder"
20
+ @select="onSelect" :keywordQueryNode="props.keywordQueryNode" :idQueryNode="props.idQueryNode" />
21
+ </template>
22
+
23
+ <script setup>
24
+ import { reactive, onMounted, watch } from "vue";
25
+ import util from "@/util"
26
+ import { useVModel } from '@vueuse/core'
27
+ import CascaderPop from './CascaderPop.vue'
28
+
29
+ const props = defineProps({
30
+ modelValue: {
31
+ type: [String, Array, Number],
32
+ default: null,
33
+ },
34
+ multiple: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ label: {
39
+ type: String,
40
+ default: "",
41
+ },
42
+ placeholder: {
43
+ type: String,
44
+ default: "",
45
+ },
46
+ required: {
47
+ type: Boolean,
48
+ default: false,
49
+ },
50
+ readonly: {
51
+ type: Boolean,
52
+ default: true,
53
+ },
54
+ rules: {
55
+ type: Array,
56
+ default: [],
57
+ },
58
+ auth: {
59
+ type: String,
60
+ default: "",
61
+ },
62
+ keywordQueryNode: {
63
+ type: Function,
64
+ default: () => { }
65
+ },
66
+ idQueryNode: {
67
+ type: Function,
68
+ default: () => { }
69
+ },
70
+ });
71
+
72
+ // 弹出层
73
+ const data = reactive({
74
+ isShowPop: false,
75
+ selectedNodes: [],
76
+ selectedNodeId: null
77
+ })
78
+
79
+ // 定义emit
80
+ const emit = defineEmits(["update:modelValue", "select"]);
81
+ const modelValue = useVModel(props, 'modelValue', emit)
82
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
83
+
84
+ //首页加载
85
+ onMounted(() => {
86
+ })
87
+
88
+ const onSelect = (node) => {
89
+ if (!props.multiple) {
90
+ data.selectedNodes = [node]
91
+ emit('select', data.selectedNodes[0])
92
+ modelValue.value = node.id
93
+ }
94
+ else {
95
+ let one = data.selectedNodes.find(item => item.id === node.id)
96
+ if (!one)
97
+ data.selectedNodes = [...data.selectedNodes, node]
98
+ emit('select', data.selectedNodes)
99
+ modelValue.value = data.selectedNodes.map(item => item.id)
100
+ }
101
+ }
102
+
103
+ const onDelete = (idx) => {
104
+ if (!props.multiple) {
105
+ modelValue.value = null
106
+ } else {
107
+ modelValue.value.splice(idx, 1)
108
+ }
109
+ }
110
+
111
+ watch(() => JSON.stringify(modelValue.value), async (n, o) => {
112
+ if (!props.multiple) {
113
+ data.selectedNodeId = modelValue.value
114
+ } else {
115
+ data.selectedNodes = []
116
+ let ids = modelValue.value || []
117
+ ids.forEach(async (id) => {
118
+ let params = {}
119
+ params.id = id
120
+ params.isReturnParent = false
121
+ params.hasChildren = false
122
+ params.hasPaths= true
123
+ await props.idQueryNode(params, (node) => {
124
+ data.selectedNodes = [...data.selectedNodes, node]
125
+ })
126
+ })
127
+ }
128
+ }, {
129
+ immediate: true
130
+ })
131
+ </script>
132
+
133
133
  <style scoped></style>