widget.qw 1.0.14 → 1.0.16

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,10 @@
1
+ NODE_ENV ='development'
2
+
3
+ VITE_DOMAIN= 'https://www.hbhjhx.asia'
4
+ VITE_TOKEN_KEY='Authorization'
5
+ VITE_TOKEN_PREFIX='Bearer '
6
+ VITE_NEED_LOGIN_CODE=401
7
+ # 注意:发布时 VITE_IS_DEBUG必须配置为false
8
+ # 本地开发时 VITE_IS_DEBUG必须配置为true
9
+ VITE_IS_DEBUG=true
10
+ VITE_DEBUG_TOKEN= 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJIb3VNdSIsInJuU3RyIjoiekRaM2g2RFpGTzZta2psYnh4cmlZUHVGNmd0SnloOTUifQ.RbYHsukUgLZ6KwtktTHByCkRBLDs4Wrjz4Vb4mGSINg'
@@ -0,0 +1,9 @@
1
+ NODE_ENV ='production'
2
+
3
+ VITE_DOMAIN= 'https://www.hbhjhx.asia'
4
+ VITE_TOKEN_KEY='Authorization'
5
+ VITE_TOKEN_PREFIX='Bearer '
6
+ VITE_NEED_LOGIN_CODE=401
7
+ # 注意:发布时 VITE_IS_DEBUG必须配置为false
8
+ # 本地开发时 VITE_IS_DEBUG必须配置为true
9
+ VITE_IS_DEBUG=false
package/README.md CHANGED
@@ -30,7 +30,7 @@ import {WIDGETQW,setup} from 'widget.qw'
30
30
  import 'widget.qw/build/style.css'
31
31
  setup({
32
32
  urlCallback: ()=>{
33
- return process.env.VUE_APP_DOMAIN
33
+ return import.meta.env.DOMAIN
34
34
  },
35
35
  tokenCallback: ()=>{
36
36
  return util.getToken()
package/build/style.css CHANGED
@@ -387,18 +387,18 @@
387
387
  color: #969799;
388
388
  margin-right: 5px;
389
389
  }
390
- [data-v-7a64f836] .label {
390
+ [data-v-87dcb274] .label {
391
391
  color: #000 !important;
392
392
  }
393
- [data-v-7a64f836] .van-field__control:disabled {
393
+ [data-v-87dcb274] .van-field__control:disabled {
394
394
  color: #000 !important;
395
395
  cursor: not-allowed;
396
396
  opacity: 1;
397
397
  -webkit-text-fill-color: #000;
398
- }.widget[data-v-d659bcb6] {
398
+ }.widget[data-v-93421532] {
399
399
  text-align: center;
400
400
  }
401
- .widget .btn[data-v-d659bcb6] {
401
+ .widget .btn[data-v-93421532] {
402
402
  position: fixed;
403
403
  bottom: 1rem;
404
404
  left: 0;
@@ -412,10 +412,10 @@
412
412
  text-align: center;
413
413
  display: inline-block;
414
414
  border-radius: 2px;
415
- }[data-v-78f50d19] .label {
415
+ }[data-v-a0846250] .label {
416
416
  color: #000 !important;
417
417
  }
418
- [data-v-78f50d19] .van-field__control:disabled {
418
+ [data-v-a0846250] .van-field__control:disabled {
419
419
  color: #000 !important;
420
420
  cursor: not-allowed;
421
421
  opacity: 1;
@@ -2945,7 +2945,7 @@ var lib = {
2945
2945
  parse,
2946
2946
  stringify
2947
2947
  };
2948
- const NEED_LOGIN = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_NEED_LOGIN_CODE;
2948
+ const NEED_LOGIN = Number("401");
2949
2949
  const NEED_LOGIN_CODES = [
2950
2950
  NEED_LOGIN
2951
2951
  ];
@@ -2955,8 +2955,8 @@ function setCacheValueByKey(key, val) {
2955
2955
  function removeCacheByKey(key) {
2956
2956
  localStorage.removeItem(key);
2957
2957
  }
2958
- const TOKEN_KEY = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_TOKEN_KEY;
2959
- const TOKEN_PREFIX = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_TOKEN_PREFIX;
2958
+ const TOKEN_KEY = "Authorization";
2959
+ const TOKEN_PREFIX = "Bearer ";
2960
2960
  function getToken() {
2961
2961
  if (vm.tokenCallback)
2962
2962
  return vm.tokenCallback();
@@ -18333,7 +18333,7 @@ const _sfc_main$j = {
18333
18333
  }
18334
18334
  };
18335
18335
  var UserSelector = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-6c4b4fc8"]]);
18336
- var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-7a64f836] .label {\n color: #000 !important;\n}\n[data-v-7a64f836] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18336
+ var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-87dcb274] .label {\n color: #000 !important;\n}\n[data-v-87dcb274] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18337
18337
  const _hoisted_1$b = {
18338
18338
  class: "image-box"
18339
18339
  };
@@ -18398,7 +18398,7 @@ const _sfc_main$i = {
18398
18398
  file: compress_file
18399
18399
  };
18400
18400
  return util.file_upload(params).then((res) => {
18401
- modelValue.value = res.data.url;
18401
+ modelValue.value = res.data;
18402
18402
  return Promise.resolve(file);
18403
18403
  });
18404
18404
  });
@@ -18444,8 +18444,8 @@ const _sfc_main$i = {
18444
18444
  };
18445
18445
  }
18446
18446
  };
18447
- var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-7a64f836"]]);
18448
- var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-d659bcb6] {\n text-align: center;\n}\n.widget .btn[data-v-d659bcb6] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
18447
+ var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-87dcb274"]]);
18448
+ var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-93421532] {\n text-align: center;\n}\n.widget .btn[data-v-93421532] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
18449
18449
  const _hoisted_1$a = {
18450
18450
  class: "image-box"
18451
18451
  };
@@ -18516,9 +18516,9 @@ const _sfc_main$h = {
18516
18516
  return util.file_upload(params).then((res) => {
18517
18517
  let newUrls = [];
18518
18518
  if (props.modelValue && props.modelValue.length > 0)
18519
- newUrls = [...props.modelValue, res.data.url];
18519
+ newUrls = [...props.modelValue, res.data];
18520
18520
  else
18521
- newUrls = [res.data.url];
18521
+ newUrls = [res.data];
18522
18522
  emit("update:modelValue", newUrls);
18523
18523
  return Promise.resolve(file);
18524
18524
  });
@@ -18570,8 +18570,8 @@ const _sfc_main$h = {
18570
18570
  };
18571
18571
  }
18572
18572
  };
18573
- var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-d659bcb6"]]);
18574
- var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-78f50d19] .label {\n color: #000 !important;\n}\n[data-v-78f50d19] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18573
+ var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-93421532"]]);
18574
+ var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-a0846250] .label {\n color: #000 !important;\n}\n[data-v-a0846250] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18575
18575
  const _hoisted_1$9 = {
18576
18576
  class: "image-box"
18577
18577
  };
@@ -18632,7 +18632,7 @@ const _sfc_main$g = {
18632
18632
  file: file.file
18633
18633
  };
18634
18634
  return util.file_upload(params).then((res) => {
18635
- modelValue.value = res.data.url;
18635
+ modelValue.value = res.data;
18636
18636
  return Promise.resolve(file);
18637
18637
  });
18638
18638
  });
@@ -18684,7 +18684,7 @@ const _sfc_main$g = {
18684
18684
  };
18685
18685
  }
18686
18686
  };
18687
- var FilePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-78f50d19"]]);
18687
+ var FilePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-a0846250"]]);
18688
18688
  var SingleUserSelector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.user-popup[data-v-a489ca4c] {\r\n width: 100%;\r\n overflow: hidden;\n}\n.department-selector[data-v-a489ca4c] {\r\n padding: 10px;\n}\n.search-buttons[data-v-a489ca4c] {\r\n display: flex;\r\n gap: 10px;\n}\n.clear-btn[data-v-a489ca4c] {\r\n background-color: #f2f3f5;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.confirm-btn[data-v-a489ca4c] {\r\n background-color: #1989fa;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.no-results[data-v-a489ca4c] {\r\n text-align: center;\r\n padding: 20px;\r\n color: #969799;\n}\n.picker-header[data-v-a489ca4c] {\r\n padding: 10px;\r\n border-bottom: 1px solid #ebedf0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.current-path[data-v-a489ca4c] {\r\n flex: 1;\r\n font-size: 14px;\r\n color: #323233;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\n.header-right[data-v-a489ca4c] {\r\n display: flex;\r\n gap: 8px;\r\n margin-left: auto;\n}\n.cancel-btn[data-v-a489ca4c] {\r\n color: #969799;\r\n margin-right: 5px;\n}\n.scroll-container[data-v-a489ca4c] {\r\n height: calc(80vh - 150px);\r\n overflow-y: auto;\n}\r\n")();
18689
18689
  const _hoisted_1$8 = {
18690
18690
  class: "department-selector"
@@ -2948,7 +2948,7 @@ var __async = (__this, __arguments, generator) => {
2948
2948
  parse,
2949
2949
  stringify
2950
2950
  };
2951
- const NEED_LOGIN = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_NEED_LOGIN_CODE;
2951
+ const NEED_LOGIN = Number("401");
2952
2952
  const NEED_LOGIN_CODES = [
2953
2953
  NEED_LOGIN
2954
2954
  ];
@@ -2958,8 +2958,8 @@ var __async = (__this, __arguments, generator) => {
2958
2958
  function removeCacheByKey(key) {
2959
2959
  localStorage.removeItem(key);
2960
2960
  }
2961
- const TOKEN_KEY = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_TOKEN_KEY;
2962
- const TOKEN_PREFIX = { "VUE_APP_DOMAIN": "https://www.hbhjhx.asia", "VUE_APP_TOKEN_KEY": "Authorization", "VUE_APP_TOKEN_PREFIX": "Bearer ", "VUE_APP_NEED_LOGIN_CODE": 401, "VUE_APP_IS_DEBUG": false, "VUE_APP_DEBUG_TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns" }.VUE_APP_TOKEN_PREFIX;
2961
+ const TOKEN_KEY = "Authorization";
2962
+ const TOKEN_PREFIX = "Bearer ";
2963
2963
  function getToken() {
2964
2964
  if (vm.tokenCallback)
2965
2965
  return vm.tokenCallback();
@@ -18336,7 +18336,7 @@ var __async = (__this, __arguments, generator) => {
18336
18336
  }
18337
18337
  };
18338
18338
  var UserSelector = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-6c4b4fc8"]]);
18339
- var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-7a64f836] .label {\n color: #000 !important;\n}\n[data-v-7a64f836] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18339
+ var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-87dcb274] .label {\n color: #000 !important;\n}\n[data-v-87dcb274] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18340
18340
  const _hoisted_1$b = {
18341
18341
  class: "image-box"
18342
18342
  };
@@ -18401,7 +18401,7 @@ var __async = (__this, __arguments, generator) => {
18401
18401
  file: compress_file
18402
18402
  };
18403
18403
  return util.file_upload(params).then((res) => {
18404
- modelValue.value = res.data.url;
18404
+ modelValue.value = res.data;
18405
18405
  return Promise.resolve(file);
18406
18406
  });
18407
18407
  });
@@ -18447,8 +18447,8 @@ var __async = (__this, __arguments, generator) => {
18447
18447
  };
18448
18448
  }
18449
18449
  };
18450
- var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-7a64f836"]]);
18451
- var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-d659bcb6] {\n text-align: center;\n}\n.widget .btn[data-v-d659bcb6] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
18450
+ var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-87dcb274"]]);
18451
+ var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-93421532] {\n text-align: center;\n}\n.widget .btn[data-v-93421532] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
18452
18452
  const _hoisted_1$a = {
18453
18453
  class: "image-box"
18454
18454
  };
@@ -18519,9 +18519,9 @@ var __async = (__this, __arguments, generator) => {
18519
18519
  return util.file_upload(params).then((res) => {
18520
18520
  let newUrls = [];
18521
18521
  if (props.modelValue && props.modelValue.length > 0)
18522
- newUrls = [...props.modelValue, res.data.url];
18522
+ newUrls = [...props.modelValue, res.data];
18523
18523
  else
18524
- newUrls = [res.data.url];
18524
+ newUrls = [res.data];
18525
18525
  emit("update:modelValue", newUrls);
18526
18526
  return Promise.resolve(file);
18527
18527
  });
@@ -18573,8 +18573,8 @@ var __async = (__this, __arguments, generator) => {
18573
18573
  };
18574
18574
  }
18575
18575
  };
18576
- var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-d659bcb6"]]);
18577
- var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-78f50d19] .label {\n color: #000 !important;\n}\n[data-v-78f50d19] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18576
+ var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-93421532"]]);
18577
+ var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-a0846250] .label {\n color: #000 !important;\n}\n[data-v-a0846250] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
18578
18578
  const _hoisted_1$9 = {
18579
18579
  class: "image-box"
18580
18580
  };
@@ -18635,7 +18635,7 @@ var __async = (__this, __arguments, generator) => {
18635
18635
  file: file.file
18636
18636
  };
18637
18637
  return util.file_upload(params).then((res) => {
18638
- modelValue.value = res.data.url;
18638
+ modelValue.value = res.data;
18639
18639
  return Promise.resolve(file);
18640
18640
  });
18641
18641
  });
@@ -18687,7 +18687,7 @@ var __async = (__this, __arguments, generator) => {
18687
18687
  };
18688
18688
  }
18689
18689
  };
18690
- var FilePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-78f50d19"]]);
18690
+ var FilePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-a0846250"]]);
18691
18691
  var SingleUserSelector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.user-popup[data-v-a489ca4c] {\r\n width: 100%;\r\n overflow: hidden;\n}\n.department-selector[data-v-a489ca4c] {\r\n padding: 10px;\n}\n.search-buttons[data-v-a489ca4c] {\r\n display: flex;\r\n gap: 10px;\n}\n.clear-btn[data-v-a489ca4c] {\r\n background-color: #f2f3f5;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.confirm-btn[data-v-a489ca4c] {\r\n background-color: #1989fa;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n padding: 4px 8px;\r\n font-size: 14px;\n}\n.no-results[data-v-a489ca4c] {\r\n text-align: center;\r\n padding: 20px;\r\n color: #969799;\n}\n.picker-header[data-v-a489ca4c] {\r\n padding: 10px;\r\n border-bottom: 1px solid #ebedf0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.current-path[data-v-a489ca4c] {\r\n flex: 1;\r\n font-size: 14px;\r\n color: #323233;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\n}\n.header-right[data-v-a489ca4c] {\r\n display: flex;\r\n gap: 8px;\r\n margin-left: auto;\n}\n.cancel-btn[data-v-a489ca4c] {\r\n color: #969799;\r\n margin-right: 5px;\n}\n.scroll-container[data-v-a489ca4c] {\r\n height: calc(80vh - 150px);\r\n overflow-y: auto;\n}\r\n")();
18692
18692
  const _hoisted_1$8 = {
18693
18693
  class: "department-selector"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "widget.qw",
3
3
  "private": false,
4
- "version": "1.0.14",
4
+ "version": "1.0.16",
5
5
  "description": "marqstree Vue3组件库",
6
6
  "main": "build/widget.qw.es.js",
7
7
  "keywords": [
package/src/App.vue CHANGED
@@ -9,7 +9,7 @@
9
9
  import { onMounted } from 'vue';
10
10
 
11
11
  onMounted(() => {
12
-
12
+ console.log('111111111111111',import.meta.env)
13
13
  })
14
14
  </script>
15
15
 
@@ -68,7 +68,7 @@ const onAfterRead = async (file) => {
68
68
  }
69
69
 
70
70
  return util.file_upload(params).then(res => {
71
- modelValue.value = res.data.url
71
+ modelValue.value = res.data
72
72
  return Promise.resolve(file)
73
73
  })
74
74
  }
@@ -74,7 +74,7 @@ const onAfterRead = async (file) => {
74
74
  }
75
75
 
76
76
  return util.file_upload(params).then(res => {
77
- modelValue.value = res.data.url
77
+ modelValue.value = res.data
78
78
  return Promise.resolve(file)
79
79
  })
80
80
  }
@@ -80,9 +80,9 @@ const onAfterRead = async(file) => {
80
80
  return util.file_upload(params).then(res => {
81
81
  let newUrls = []
82
82
  if (props.modelValue && props.modelValue.length > 0)
83
- newUrls = [...props.modelValue, res.data.url]
83
+ newUrls = [...props.modelValue, res.data]
84
84
  else
85
- newUrls = [res.data.url]
85
+ newUrls = [res.data]
86
86
 
87
87
  emit('update:modelValue', newUrls)
88
88
  return Promise.resolve(file)
package/src/main.js CHANGED
@@ -52,7 +52,7 @@ import "vant/lib/index.css";
52
52
  import { WidgetQw, setup } from "@/components";
53
53
  setup({
54
54
  urlCallback: () => {
55
- return process.env.VUE_APP_DOMAIN;
55
+ return import.meta.env.VITE_DOMAIN;
56
56
  },
57
57
  tokenCallback: () => {
58
58
  return util.getToken()
@@ -61,10 +61,10 @@ setup({
61
61
  router.push({ path: "/login" });
62
62
  },
63
63
  gstepBaseUrlCallback: () => {
64
- return `${process.env.VUE_APP_DOMAIN}/gstep-api`
64
+ return `${import.meta.env.VITE_DOMAIN}/gstep-api`
65
65
  },
66
66
  fileUploadUrlCallback: ()=>{
67
- return `${process.env.VUE_APP_DOMAIN}/ac-api/file/upload`
67
+ return `${import.meta.env.VITE_DOMAIN}/ac-api/file/upload`
68
68
  }
69
69
  });
70
70
 
@@ -153,7 +153,7 @@ const routes: Array<RouteRecordRaw> = [
153
153
  ]
154
154
 
155
155
  const router = createRouter({
156
- history: createWebHashHistory(process.env.BASE_URL),
156
+ history: createWebHashHistory(import.meta.env.BASE_URL),
157
157
  routes,
158
158
  scrollBehavior(to, from, savedPosition) {
159
159
  return { top: 0 }; // 强制滚动到顶部
@@ -3,12 +3,12 @@ import { computed } from 'vue'
3
3
  import vm from '../vm'
4
4
 
5
5
  //登陆token的键名
6
- export const TOKEN_KEY = process.env.VUE_APP_TOKEN_KEY;
7
- export const TOKEN_PREFIX = process.env.VUE_APP_TOKEN_PREFIX;
6
+ export const TOKEN_KEY = import.meta.env.VITE_TOKEN_KEY;
7
+ export const TOKEN_PREFIX = import.meta.env.VITE_TOKEN_PREFIX;
8
8
 
9
9
  export function getToken() {
10
- if (process.env.VUE_APP_IS_DEBUG)
11
- return TOKEN_PREFIX + process.env.VUE_APP_DEBUG_TOKEN
10
+ if (import.meta.env.VITE_IS_DEBUG === 'true')
11
+ return TOKEN_PREFIX + import.meta.env.VITE_DEBUG_TOKEN
12
12
  else if(vm.tokenCallback)
13
13
  return vm.tokenCallback()
14
14
  }
@@ -1,6 +1,6 @@
1
1
  // 返回这些错误码都要清除cookie及local storage
2
2
  //未登录 错误码
3
- const NEED_LOGIN = process.env.VUE_APP_NEED_LOGIN_CODE;
3
+ const NEED_LOGIN = Number(import.meta.env.VITE_NEED_LOGIN_CODE)
4
4
 
5
5
  export const NEED_LOGIN_CODES = [
6
6
  NEED_LOGIN,
package/vite.config.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { defineConfig, loadEnv } from 'vite'
1
2
  import vue from "@vitejs/plugin-vue";
2
3
  import styleImport, { VantResolve } from "vite-plugin-style-import";
3
4
  import { resolve } from "path"; // 主要用于alias文件路径别名
@@ -5,69 +6,117 @@ import { resolve } from "path"; // 主要用于alias文件路径别名
5
6
  import requireTransform from "vite-plugin-require-transform";
6
7
  const path = require("path");
7
8
 
8
- export default {
9
- build: {
10
- outDir: 'build',
11
- target: 'es2015',
12
- // minify: 'esbuild',
13
- minify: false,
14
- cssTarget: 'chrome80',
15
- chunkSizeWarningLimit: 2000,
16
- lib: {
17
- entry: path.resolve(__dirname, "./src/components/index.js"), //指定组件编译入口文件
18
- name: "widget.qw",
19
- fileName: "widget.qw",
20
- },
21
- rollupOptions: {
22
- // 确保外部化处理那些你不想打包进库的依赖
23
- external: ["vue"],
24
- output: {
25
- // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
26
- globals: {
27
- vue: "Vue",
28
- },
9
+
10
+ export default defineConfig(({ mode }) => {
11
+ const env = loadEnv(mode, process.cwd(), "");
12
+
13
+ return {
14
+ build: {
15
+ outDir: 'build',
16
+ target: 'es2015',
17
+ // minify: 'esbuild',
18
+ minify: false,
19
+ cssTarget: 'chrome80',
20
+ chunkSizeWarningLimit: 2000,
21
+ lib: {
22
+ entry: path.resolve(__dirname, "./src/components/index.js"), //指定组件编译入口文件
23
+ name: "widget.qw",
24
+ fileName: "widget.qw",
29
25
  },
30
- }, // rollup打包配置
31
- },
32
- //打包配置,一定要加,否则路径不对,找不到js/css文件
33
- //作用:打包index.html中的js/css文件前加相对路径./
34
- base: "./",
35
- define: {
36
- 'process.env': {
37
- VUE_APP_DOMAIN: 'https://www.hbhjhx.asia',
38
- VUE_APP_TOKEN_KEY: 'Authorization',
39
- VUE_APP_TOKEN_PREFIX: 'Bearer ',
40
- VUE_APP_NEED_LOGIN_CODE: 401,
41
- //注意:发布时 VUE_APP_IS_DEBUG必须配置为false
42
- // 本地开发时 VUE_APP_IS_DEBUG必须配置为true
43
- VUE_APP_IS_DEBUG: false,
44
- // VUE_APP_IS_DEBUG: true,
45
- VUE_APP_DEBUG_TOKEN: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns'
26
+ rollupOptions: {
27
+ // 确保外部化处理那些你不想打包进库的依赖
28
+ external: ["vue"],
29
+ output: {
30
+ // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
31
+ globals: {
32
+ vue: "Vue",
33
+ },
34
+ },
35
+ }, // rollup打包配置
46
36
  },
47
- },
48
- resolve: {
49
- // 配置路径别名
50
- alias: {
51
- "@": path.resolve(__dirname, "./src"),
52
- "*": resolve(""),
37
+ //打包配置,一定要加,否则路径不对,找不到js/css文件
38
+ //作用:打包index.html中的js/css文件前加相对路径./
39
+ base: "./",
40
+ // 如果需要在客户端代码中注入非VITE_前缀的变量
41
+ define: {},
42
+ resolve: {
43
+ // 配置路径别名
44
+ alias: {
45
+ "@": path.resolve(__dirname, "./src"),
46
+ "*": resolve(""),
47
+ },
53
48
  },
54
- },
55
- plugins: [
56
- vue(),
57
- // 引入vant的样式依赖
58
- // styleImport({
59
- // resolves: [VantResolve()],
60
- // libs: [
61
- // {
62
- // libraryName: 'vant',
63
- // esModule: true,
64
- // resolveStyle: (name) => `../es/${name}/style`,
65
- // },
66
- // ],
67
- // }),
68
- //vite版require配置
69
- requireTransform({
70
- fileRegex: /.ts$|.vue$/,
71
- }),
72
- ],
73
- };
49
+ plugins: [
50
+ vue(),
51
+ // 引入vant的样式依赖
52
+ // styleImport({
53
+ // resolves: [VantResolve()],
54
+ // libs: [
55
+ // {
56
+ // libraryName: 'vant',
57
+ // esModule: true,
58
+ // resolveStyle: (name) => `../es/${name}/style`,
59
+ // },
60
+ // ],
61
+ // }),
62
+ //vite版require配置
63
+ requireTransform({
64
+ fileRegex: /.ts$|.vue$/,
65
+ }),
66
+ ],
67
+ }
68
+ })
69
+
70
+ // export default {
71
+ // build: {
72
+ // outDir: 'build',
73
+ // target: 'es2015',
74
+ // // minify: 'esbuild',
75
+ // minify: false,
76
+ // cssTarget: 'chrome80',
77
+ // chunkSizeWarningLimit: 2000,
78
+ // lib: {
79
+ // entry: path.resolve(__dirname, "./src/components/index.js"), //指定组件编译入口文件
80
+ // name: "widget.qw",
81
+ // fileName: "widget.qw",
82
+ // },
83
+ // rollupOptions: {
84
+ // // 确保外部化处理那些你不想打包进库的依赖
85
+ // external: ["vue"],
86
+ // output: {
87
+ // // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
88
+ // globals: {
89
+ // vue: "Vue",
90
+ // },
91
+ // },
92
+ // }, // rollup打包配置
93
+ // },
94
+ // //打包配置,一定要加,否则路径不对,找不到js/css文件
95
+ // //作用:打包index.html中的js/css文件前加相对路径./
96
+ // base: "./",
97
+ // resolve: {
98
+ // // 配置路径别名
99
+ // alias: {
100
+ // "@": path.resolve(__dirname, "./src"),
101
+ // "*": resolve(""),
102
+ // },
103
+ // },
104
+ // plugins: [
105
+ // vue(),
106
+ // // 引入vant的样式依赖
107
+ // // styleImport({
108
+ // // resolves: [VantResolve()],
109
+ // // libs: [
110
+ // // {
111
+ // // libraryName: 'vant',
112
+ // // esModule: true,
113
+ // // resolveStyle: (name) => `../es/${name}/style`,
114
+ // // },
115
+ // // ],
116
+ // // }),
117
+ // //vite版require配置
118
+ // requireTransform({
119
+ // fileRegex: /.ts$|.vue$/,
120
+ // }),
121
+ // ],
122
+ // };