vue2-client 1.15.82 → 1.15.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.15.82",
3
+ "version": "1.15.84",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -60,6 +60,7 @@
60
60
  "viser-vue": "^2.4.8",
61
61
  "vue": "^2.7.14",
62
62
  "vue-codemirror": "4.0.6",
63
+ "vue-color": "2.7.0",
63
64
  "vue-draggable-resizable": "^2.3.0",
64
65
  "vue-i18n": "^8.28.2",
65
66
  "vue-json-viewer": "^2.2.22",
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <div id="colorPickerCombobox" style="padding: 4px 0;">
3
+ <div style="display: flex; width: 100%;">
4
+ <a-input
5
+ :value="colorValue"
6
+ :read-only="readOnly"
7
+ style="flex: 1; min-width: 0;"
8
+ placeholder="请选择颜色"
9
+ />
10
+ <a-button
11
+ style="flex-shrink: 0; margin-left: 0.2rem;"
12
+ @click="visible = true"
13
+ >
14
+ 选择颜色
15
+ </a-button>
16
+ </div>
17
+ <a-modal
18
+ v-model="visible"
19
+ title="颜色选择"
20
+ @ok="onSelect"
21
+ :zIndex="1002"
22
+ :destroyOnClose="true"
23
+ width="40%"
24
+ >
25
+ <chrome-picker
26
+ :value="tempColor"
27
+ :disable-alpha="true"
28
+ @input="onColorChange"
29
+ />
30
+ <div style="margin-top: 16px; text-align: center;">
31
+ <span>当前颜色: <span :style="{ color: tempColor }">{{ tempColor }}</span></span>
32
+ </div>
33
+ </a-modal>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import { Chrome } from 'vue-color'
39
+
40
+ export default {
41
+ name: 'ColorPickerCombobox',
42
+ components: {
43
+ 'chrome-picker': Chrome
44
+ },
45
+ props: {
46
+ value: {
47
+ type: String,
48
+ default: ''
49
+ },
50
+ readOnly: {
51
+ type: Boolean,
52
+ default: false
53
+ }
54
+ },
55
+ data () {
56
+ return {
57
+ visible: false,
58
+ colorValue: this.value,
59
+ tempColor: this.value
60
+ }
61
+ },
62
+ watch: {
63
+ value (val) {
64
+ this.colorValue = val
65
+ this.tempColor = val
66
+ }
67
+ },
68
+ methods: {
69
+ onColorChange (color) {
70
+ // color.hex 是 #RRGGBB 格式
71
+ this.tempColor = color.hex
72
+ },
73
+ onSelect () {
74
+ this.colorValue = this.tempColor
75
+ this.visible = false
76
+ this.$emit('onSelect', this.colorValue)
77
+ },
78
+ setColor (val) {
79
+ this.colorValue = val
80
+ this.tempColor = val
81
+ }
82
+ }
83
+ }
84
+ </script>
85
+
86
+ <style lang="less" scoped>
87
+ #colorPickerCombobox {
88
+ .ant-input {
89
+ background: #fff;
90
+ }
91
+ }
92
+ .vc-chrome {
93
+ width: 100% !important;
94
+ box-sizing: border-box;
95
+ }
96
+ ::v-deep .vc-chrome {
97
+ width: 100% !important;
98
+ }
99
+ </style>
@@ -0,0 +1,34 @@
1
+ <script>
2
+
3
+ import ColorPickerCombobox from '@vue2-client/base-client/components/common/ColorPickerCombobox/ColorPickerCombobox.vue'
4
+
5
+ export default {
6
+ name: 'Demo',
7
+ components: { ColorPickerCombobox },
8
+ data () {
9
+ return {
10
+ visible: false,
11
+ searchResult: {}
12
+ }
13
+ },
14
+ methods: {
15
+ colorPickerComboboxSelect (res) {
16
+ console.log('===colorPickerComboboxSelect', res)
17
+ }
18
+ }
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <div>
24
+ <ColorPickerCombobox
25
+ v-model="searchResult"
26
+ searchResultType="Object"
27
+ @onSelect="colorPickerComboboxSelect"
28
+ ></ColorPickerCombobox>
29
+ </div>
30
+ </template>
31
+
32
+ <style scoped lang="less">
33
+
34
+ </style>
@@ -472,6 +472,24 @@
472
472
  ></address-search-combobox>
473
473
  </a-form-model-item>
474
474
  </x-form-col>
475
+ <!-- 颜色选择器 -->
476
+ <x-form-col
477
+ v-else-if="attr.type === 'colorPicker' && show"
478
+ :labelCol="labelCol"
479
+ :flex="attr.flex">
480
+ <a-form-model-item
481
+ v-bind="bindOther"
482
+ :rules="rules"
483
+ :ref="attr.model"
484
+ :label="showLabel?attr.name:undefined"
485
+ :prop="attr.prop ? attr.prop : attr.model">
486
+ <color-picker-combobox
487
+ :value="form[attr.model]"
488
+ :read-only="readOnly"
489
+ @onSelect="colorPickerComboboxSelect"
490
+ />
491
+ </a-form-model-item>
492
+ </x-form-col>
475
493
  <!-- 人员选择框 -->
476
494
  <x-form-col
477
495
  v-else-if="attr.type === 'personSetting' && show"
@@ -697,6 +715,7 @@ import XFormDatePicker from '@vue2-client/base-client/components/common/XDatePic
697
715
  import XIntervalPicker from '@vue2-client/base-client/components/common/XIntervalPicker/XIntervalPicker.vue'
698
716
  import XRate from '@vue2-client/base-client/components/common/XRate/index.vue'
699
717
  import { post } from '@vue2-client/services/api/restTools'
718
+ import ColorPickerCombobox from '@vue2-client/base-client/components/common/ColorPickerCombobox/ColorPickerCombobox.vue'
700
719
 
701
720
  export default {
702
721
  name: 'XFormItem',
@@ -716,7 +735,8 @@ export default {
716
735
  XStatusButton,
717
736
  XClickChangeBtn,
718
737
  XIntervalPicker,
719
- XRate
738
+ XRate,
739
+ ColorPickerCombobox
720
740
  },
721
741
  data () {
722
742
  // 检索去抖
@@ -1347,6 +1367,9 @@ export default {
1347
1367
  // return document.body
1348
1368
  return triggerNode.parentNode
1349
1369
  },
1370
+ colorPickerComboboxSelect (val) {
1371
+ this.form[this.attr.model] = val
1372
+ },
1350
1373
  }
1351
1374
  }
1352
1375
  </script>
@@ -26,7 +26,7 @@ export default {
26
26
  data () {
27
27
  return {
28
28
  // 查询配置文件名
29
- queryParamsName: 'ceshiCRUD',
29
+ queryParamsName: 'ceshiColorCRUD',
30
30
  // 新增表单固定值
31
31
  fixedAddForm: {},
32
32
  // 是否显示详情抽屉
@@ -228,13 +228,13 @@
228
228
  <a-col
229
229
  :span="item.span"
230
230
  v-for="(item,index) in chartsConfigArray"
231
- :key="index"
231
+ :key="`${queryParamsName}-${index}`"
232
232
  style="height: 20rem; margin-bottom: 3rem">
233
233
  <div class="custom-chart-title" v-if="item.config.title">{{ item.config.title }}</div>
234
234
  <div class="custom-chart-desc" v-if="item.config.description">{{ item.config.description }}</div>
235
235
  <g2Charts
236
- :key="index"
237
- :chatsKey="index"
236
+ :key="`${queryParamsName}-${index}`"
237
+ :chatsKey="`${queryParamsName}-${index}`"
238
238
  :is-dev="env === 'dev'"
239
239
  :config="item.config"
240
240
  :requestParameters="requestParameters"/>
@@ -54,13 +54,13 @@ routerResource.example = {
54
54
  path: 'example',
55
55
  name: '示例主页面',
56
56
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
57
- component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
57
+ // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
58
58
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
59
59
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
60
60
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
62
62
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
63
- // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
63
+ component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
64
64
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
65
65
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
66
66
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),