meixioacomponent 2.0.40 → 2.0.42

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.
@@ -0,0 +1,50 @@
1
+ import {GetAreaTree} from "../base/baseArea/api";
2
+ import {ref} from "vue";
3
+
4
+ const useHookByBaseArea = () => {
5
+ const loading = ref(false);
6
+ const options = ref([]);
7
+ const placeholder = ref('请选择省市区镇')
8
+
9
+ const load = (node) => {
10
+ const {value, data} = node;
11
+ return new Promise((resolve) => {
12
+ loadArea(data ? data.code : '').then(res => {
13
+ resolve(res);
14
+ })
15
+ })
16
+ }
17
+
18
+
19
+ const loadArea = (keyword) => {
20
+ return new Promise((resolve) => {
21
+ loading.value = true;
22
+ GetAreaTree({
23
+ keyword: keyword
24
+ }).then(res => {
25
+ if (Array.isArray(res)) {
26
+ res.forEach(item => {
27
+ item[`children`] = item.level !== 4;
28
+ item[`value`] = `${item.name}-${item.code}`
29
+ })
30
+ loading.value = false;
31
+ resolve(res);
32
+ } else {
33
+ resolve([]);
34
+ }
35
+ })
36
+ })
37
+ };
38
+
39
+ return {
40
+ loading,
41
+ options,
42
+ placeholder,
43
+ load, loadArea
44
+ }
45
+
46
+
47
+ }
48
+
49
+
50
+ export default useHookByBaseArea;
@@ -0,0 +1,47 @@
1
+ import {computed} from "vue";
2
+
3
+ const useHookByGuide = (paramsByGuideControl) => {
4
+
5
+
6
+
7
+
8
+ const _guideControl = computed(() => {
9
+ return paramsByGuideControl
10
+ })
11
+
12
+ const currentStep = computed(() => {
13
+ return _guideControl.value.current;
14
+ })
15
+
16
+
17
+ const steps = computed(() => {
18
+ return _guideControl.value.steps;
19
+ })
20
+
21
+ const currentStepContent = computed(() => {
22
+ return steps.value[currentStep.value]
23
+ })
24
+
25
+
26
+ const errorIds = computed(() => {
27
+ return _guideControl.value.errorIds;
28
+ })
29
+
30
+ const useStepShow = computed(() => {
31
+ return _guideControl.value.useStepShow;
32
+ })
33
+
34
+
35
+ return {
36
+ steps,
37
+ useStepShow,
38
+ errorIds,
39
+ _guideControl,
40
+ currentStep,
41
+ currentStepContent
42
+ }
43
+
44
+ }
45
+
46
+
47
+ export default useHookByGuide;
@@ -0,0 +1,131 @@
1
+ import {computed, ref} from "vue";
2
+ import {MessagePlugin} from "tdesign-vue";
3
+ import componentConfig from "../../config/componentConfig";
4
+ import useUpload from "../../config/use/UseUpload";
5
+
6
+ const useHookByUpload = (key, options = {
7
+ props: {
8
+ max: {}
9
+ },
10
+ uploadEd: () => {
11
+ },
12
+
13
+ }) => {
14
+
15
+
16
+ const dynamicmount = ref();
17
+ const uploadLoading = ref(false);
18
+ const _module = ref([]);
19
+
20
+ let uploadPath = null;
21
+ const callBackIsLaunch = ref(false);
22
+
23
+
24
+ const setUploadPath = (value) => {
25
+ uploadPath = value;
26
+ }
27
+
28
+
29
+ const isMax = computed(() => {
30
+ return _module.value.length >= options.props.max
31
+ })
32
+
33
+
34
+ const inputChange = (list) => {
35
+ callBackIsLaunch.value = false;
36
+ for (let i = 0; i < list.length; i++) {
37
+ if (_module.value) {
38
+ if (isMax.value) {
39
+ MessagePlugin.error("超出文件上传限制");
40
+ break;
41
+ }
42
+ _module.value.push(list[i]);
43
+ }
44
+ list[i].cb = uploadEd;
45
+ list[i].key = key;
46
+ }
47
+
48
+ let isOss = true;
49
+ if (uploadPath instanceof Array) {
50
+ componentConfig.setUploadUrl(uploadPath[0], uploadPath[1]);
51
+ } else {
52
+ componentConfig.setUploadCustomUrl(uploadPath);
53
+ isOss = false;
54
+ }
55
+
56
+ if (!uploadLoading.value) {
57
+ uploadLoading.value = useUpload.toUpload(
58
+ _module.value ? _module.value : list,
59
+ uploadEd,
60
+ isOss
61
+ );
62
+ }
63
+ }
64
+
65
+
66
+ const uploadEd = async (evt) => {
67
+ let filterList = [];
68
+ let callBackParams = null;
69
+ try {
70
+ if (evt instanceof Array) {
71
+ filterList = evt
72
+ .filter((item) => {
73
+ return item.key === key;
74
+ })
75
+ .filter((item) => {
76
+ if (!item.upload || item.upload.state === 1) {
77
+ return item;
78
+ } else {
79
+ Notification.error("存在某些文件取消上传或上传失败!");
80
+ }
81
+ });
82
+
83
+ callBackParams = filterList;
84
+ } else {
85
+ if (_module.value instanceof Array) {
86
+ _module.value = _module.value.filter((item) => {
87
+ return item.url !== "cancel";
88
+ });
89
+ } else {
90
+ _module.value = null;
91
+ }
92
+ callBackParams = evt;
93
+ Notification.error(`${evt}`);
94
+ }
95
+ } catch (error) {
96
+ } finally {
97
+ if (!callBackIsLaunch.value) {
98
+ options.uploadEd && options.uploadEd(callBackParams);
99
+ callBackIsLaunch.value = true;
100
+ if (callBackParams instanceof Array) {
101
+ // 只要考虑oss
102
+ if (componentConfig.ossUploadEdAuthCallback instanceof Function) {
103
+ if (callBackParams.length > 0) {
104
+ await componentConfig.ossUploadEdAuthCallback(callBackParams);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ uploadLoading.value = false;
111
+ }
112
+ }
113
+
114
+
115
+ return {
116
+ isMax,
117
+ _module,
118
+ dynamicmount,
119
+ uploadLoading,
120
+ uploadPath,
121
+ callBackIsLaunch,
122
+ setUploadPath,
123
+ inputChange,
124
+ uploadEd,
125
+
126
+ }
127
+
128
+ }
129
+
130
+
131
+ export default useHookByUpload;
@@ -3,6 +3,7 @@ exports.__esModule = true;
3
3
  var baseAnchor_1 = require("./base/baseAnchor");
4
4
  var baseAppendix_1 = require("./base/baseAppendix");
5
5
  var baseArea_1 = require("./base/baseArea");
6
+ var baseAreaByMultiple_1 = require("./base/baseAreaByMultiple");
6
7
  var baseAvatar_1 = require("./base/baseAvatar");
7
8
  var baseButtonHandle_1 = require("./base/baseButtonHandle");
8
9
  var baseDefaultSvg_1 = require("./base/baseDefaultSvg");
@@ -94,6 +95,7 @@ var meixicomponents = [
94
95
  baseLineInfoGroup_1["default"],
95
96
  baseLineInfoItem_1["default"],
96
97
  basePageHeader_1["default"],
98
+ baseAreaByMultiple_1["default"],
97
99
  basePagination_1["default"],
98
100
  basePlainTable_1["default"],
99
101
  baseSection_1["default"],
@@ -176,6 +178,7 @@ var meixioacomponent = {
176
178
  basePagination: basePagination_1["default"],
177
179
  basePlainTable: basePlainTable_1["default"],
178
180
  baseSection: baseSection_1["default"],
181
+ baseAreaByMultiple: baseAreaByMultiple_1["default"],
179
182
  baseSkeleton: baseSkeleton_1["default"],
180
183
  baseSvg: baseSvg_1["default"],
181
184
  baseTimeTypeSelect: baseTimeTypeSelect_1["default"],
@@ -1,6 +1,7 @@
1
1
  import baseAnchor from "./base/baseAnchor";
2
2
  import baseAppendix from "./base/baseAppendix";
3
3
  import baseArea from "./base/baseArea";
4
+ import baseAreaByMultiple from "./base/baseAreaByMultiple"
4
5
  import baseAvatar from "./base/baseAvatar";
5
6
  import baseButtonHandle from "./base/baseButtonHandle";
6
7
  import baseDefaultSvg from "./base/baseDefaultSvg";
@@ -67,7 +68,6 @@ import useCropper from "../config/use/useCropper";
67
68
  import useViewVideo from "../config/use/UseViewVideo";
68
69
  import useGuide from "../config/use/UseGuide";
69
70
  import LinkViewClass from "../config/LinkViewClass";
70
-
71
71
  import 'tdesign-vue/es/style/index.css';
72
72
 
73
73
  //组件库type类型
@@ -98,6 +98,7 @@ const meixicomponents: any[] = [
98
98
  baseLineInfoGroup,
99
99
  baseLineInfoItem,
100
100
  basePageHeader,
101
+ baseAreaByMultiple,
101
102
  basePagination,
102
103
  basePlainTable,
103
104
  baseSection,
@@ -137,7 +138,6 @@ const install = (Vue) => {
137
138
  meixicomponents.forEach((baseComponent) => {
138
139
  Vue.component(baseComponent.name, baseComponent);
139
140
  });
140
-
141
141
  Vue.use(DynamicMount);
142
142
  Vue.use(VueCropper);
143
143
  Vue.use(registerConfirm);
@@ -185,6 +185,7 @@ const meixioacomponent = {
185
185
  basePagination,
186
186
  basePlainTable,
187
187
  baseSection,
188
+ baseAreaByMultiple,
188
189
  baseSkeleton,
189
190
  baseSvg,
190
191
  baseTimeTypeSelect,
@@ -0,0 +1,54 @@
1
+ import {GetAreaTree} from "../base/baseArea/api";
2
+
3
+ export const mixinsByBaseArea = {
4
+ data() {
5
+ return {
6
+ loading: false,
7
+ options: [],
8
+ placeholder: '请选择省市区镇',
9
+ }
10
+ },
11
+ mounted() {
12
+ this.loadArea('').then(res => {
13
+ this.options = res;
14
+ })
15
+ },
16
+ props: {
17
+ disable: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ size: {type: String, default: 'small'}
22
+ },
23
+ methods: {
24
+ load(node) {
25
+ const {value, data} = node;
26
+ return new Promise((resolve) => {
27
+ this.loadArea(data ? data.code : '').then(res => {
28
+ resolve(res);
29
+ })
30
+ })
31
+ },
32
+ loadArea(keyword) {
33
+ return new Promise((resolve) => {
34
+ this.loading = true;
35
+ GetAreaTree({
36
+ keyword: keyword
37
+ }).then(res => {
38
+ if (Array.isArray(res)) {
39
+ res.forEach(item => {
40
+ item[`children`] = item.level !== 4;
41
+ item[`value`] = `${item.name}-${item.code}`
42
+ })
43
+ this.loading = false;
44
+ resolve(res);
45
+ } else {
46
+ resolve([]);
47
+ }
48
+ })
49
+ })
50
+ },
51
+ }
52
+
53
+
54
+ }
@@ -333,7 +333,6 @@ export default {
333
333
  formAreaConfirm(params) {
334
334
  this.submitVerifiData(params).then(res => {
335
335
  if (res) {
336
- this.$refs[`area-${params.config.key}`][0].doClose()
337
336
  this.$emit('formItemConfirm', params.config)
338
337
  } else {
339
338
  this.$message.error('请重新选择')
package/vue.config.js CHANGED
@@ -6,15 +6,19 @@ function resolve(dir) {
6
6
  }
7
7
 
8
8
  module.exports = defineConfig({
9
- transpileDependencies: true, css: {
9
+ transpileDependencies: true,
10
+ css: {
10
11
  extract: false,
11
- }, productionSourceMap: false, configureWebpack: {
12
+ },
13
+ productionSourceMap: false,
14
+ configureWebpack: {
12
15
  resolve: {
13
- extensions: [".js", ".vue", ".json", ".ts", ".tsx"], alias: {
16
+ extensions: [".js", ".vue", ".json", ".ts", ".tsx"],
17
+ alias: {
14
18
  "@": resolve("src"),
15
19
  'zlib': false,
16
20
  "stream": false,
17
- "fs": false
21
+ "fs": false,
18
22
  }, fallback: {
19
23
  path: require.resolve("path-browserify"),
20
24
  },
@@ -28,14 +32,10 @@ module.exports = defineConfig({
28
32
  }
29
33
  }]
30
34
  }
31
- },
32
- chainWebpack(config) {
35
+ }, chainWebpack(config) {
33
36
  config.externals({
34
- 'element-ui': 'ElementUI'
35
37
  })
36
38
  }
37
-
38
-
39
39
  })
40
40
 
41
41