@newview/file-ui 1.1.13 → 1.1.14

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/dist/file-ui.js CHANGED
@@ -5,11 +5,13 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { BaseInstance } from "@newview/base-vue";
8
- import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createElementVNode, reactive, renderList, createBlock, createSlots, normalizeClass, withModifiers, createCommentVNode, toDisplayString, createTextVNode, pushScopeId, popScopeId, onMounted, onBeforeUnmount, nextTick, h, watchEffect, normalizeStyle } from "vue";
8
+ import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createElementVNode, reactive, renderList, createBlock, createSlots, normalizeClass, withModifiers, createCommentVNode, toDisplayString, createTextVNode, pushScopeId, popScopeId, onMounted, onBeforeUnmount, nextTick, h, watchEffect, normalizeStyle, withDirectives, vShow, vModelText } from "vue";
9
9
  import { QueryWrapper } from "@newview/infrastructure";
10
10
  import { OSSFileApi, FileApi, UploadApi, FileInfoApi } from "@newview/fileservice-api";
11
- import { NvDicSelect, NvStructureTypeSelect, NvStructureSelect } from "@newview/basics-ui";
12
- const propDefine$3 = {
11
+ import { loadDictionaryData } from "@newview/basics-ui";
12
+ import { DataStructureApi, StructureInstanceApi } from "@newview/basics-api";
13
+ import linq from "linq";
14
+ const propDefine$6 = {
13
15
  modelValue: {
14
16
  // 是否显示
15
17
  type: Boolean,
@@ -32,12 +34,12 @@ const propDefine$3 = {
32
34
  default: 0
33
35
  }
34
36
  };
35
- const _sfc_main$3 = defineComponent({
37
+ const _sfc_main$6 = defineComponent({
36
38
  name: "FilePreview",
37
39
  components: {},
38
40
  emits: ["update:modelValue"],
39
41
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
40
- props: propDefine$3,
42
+ props: propDefine$6,
41
43
  setup(props, ctx) {
42
44
  return new FilePreviewInstance(props, ctx);
43
45
  }
@@ -149,9 +151,9 @@ const _export_sfc = (sfc, props) => {
149
151
  }
150
152
  return target;
151
153
  };
152
- const _hoisted_1$1 = { class: "ifr-container" };
153
- const _hoisted_2$1 = ["src", "title"];
154
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
154
+ const _hoisted_1$3 = { class: "ifr-container" };
155
+ const _hoisted_2$3 = ["src", "title"];
156
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
155
157
  const _component_ImagePreview = resolveComponent("ImagePreview");
156
158
  const _component_Modal = resolveComponent("Modal");
157
159
  return openBlock(), createElementBlock(Fragment, null, [
@@ -174,20 +176,20 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
174
176
  onOnVisibleChange: _ctx.doClose
175
177
  }, {
176
178
  default: withCtx(() => [
177
- createElementVNode("div", _hoisted_1$1, [
179
+ createElementVNode("div", _hoisted_1$3, [
178
180
  createElementVNode("iframe", {
179
181
  src: _ctx.ifrUrl,
180
182
  class: "ifr-content",
181
183
  title: _ctx.fileInfo.fileInfo
182
- }, " ", 8, _hoisted_2$1)
184
+ }, " ", 8, _hoisted_2$3)
183
185
  ])
184
186
  ]),
185
187
  _: 1
186
188
  }, 8, ["modelValue", "title", "onOnVisibleChange"])
187
189
  ], 64);
188
190
  }
189
- const filePreview = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-071f536d"]]);
190
- const propDefine$2 = {
191
+ const filePreview = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-071f536d"]]);
192
+ const propDefine$5 = {
191
193
  linkParam: {
192
194
  // 带入的参数
193
195
  type: String,
@@ -254,12 +256,12 @@ const propDefine$2 = {
254
256
  default: "暂无附件"
255
257
  }
256
258
  };
257
- const _sfc_main$2 = defineComponent({
259
+ const _sfc_main$5 = defineComponent({
258
260
  name: "UploadFile",
259
261
  components: { filePreview },
260
262
  emits: ["success", "returnFileList"],
261
263
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
262
- props: propDefine$2,
264
+ props: propDefine$5,
263
265
  setup(props, ctx) {
264
266
  return new UploadFileInstance(props, ctx);
265
267
  }
@@ -600,21 +602,21 @@ class UploadFileInstance extends BaseInstance {
600
602
  //#endregion 业务逻辑 文件预览 END
601
603
  }
602
604
  const UploadFile_vue_vue_type_style_index_0_scoped_d6b14e55_lang = "";
603
- const _withScopeId = (n) => (pushScopeId("data-v-d6b14e55"), n = n(), popScopeId(), n);
604
- const _hoisted_1 = { class: "uploadFile" };
605
- const _hoisted_2 = ["onClick", "title"];
606
- const _hoisted_3 = { class: "file-upload-list-cover" };
607
- const _hoisted_4 = { class: "file-upload-btn" };
608
- const _hoisted_5 = {
605
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-d6b14e55"), n = n(), popScopeId(), n);
606
+ const _hoisted_1$2 = { class: "uploadFile" };
607
+ const _hoisted_2$2 = ["onClick", "title"];
608
+ const _hoisted_3$2 = { class: "file-upload-list-cover" };
609
+ const _hoisted_4$2 = { class: "file-upload-btn" };
610
+ const _hoisted_5$2 = {
609
611
  key: 1,
610
612
  class: "nv-flex",
611
613
  style: { "color": "#949494", "border": "1px dashed #dcdee2", "height": "60px", "padding": "0 20px", "font-size": "16px", "justify-content": "center" }
612
614
  };
613
- const _hoisted_6 = {
615
+ const _hoisted_6$2 = {
614
616
  class: "nv-flex",
615
617
  style: { "width": "40px", "margin-right": "6px" }
616
618
  };
617
- const _hoisted_7 = {
619
+ const _hoisted_7$2 = {
618
620
  t: "1706683071705",
619
621
  class: "icon",
620
622
  viewBox: "0 0 1566 1024",
@@ -623,16 +625,16 @@ const _hoisted_7 = {
623
625
  "p-id": "4559",
624
626
  style: { "fill": "currentColor" }
625
627
  };
626
- const _hoisted_8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
628
+ const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("path", {
627
629
  d: "M156.661991 699.757959h21.096999a10.443999 10.443999 0 0 1 10.235999 10.443999c0 5.765-4.491 10.443999-10.235999 10.444h-21.096999v21.097999a10.443999 10.443999 0 0 1-10.444 10.234999 10.276999 10.276999 0 0 1-10.443999-10.234999v-21.097999h-21.096999a10.443999 10.443999 0 0 1-10.234999-10.444c0-5.765 4.49-10.443999 10.234999-10.443999h21.096999v-21.096999a10.443999 10.443999 0 0 1 10.443999-10.234999c5.765 0 10.443999 4.49 10.444 10.234999v21.096999z m1378.627919-83.552995v-21.096999a10.276999 10.276999 0 0 0-10.443999-10.234999 10.443999 10.443999 0 0 0-10.444 10.234999v21.096999h-21.096998a10.276999 10.276999 0 0 0-10.235 10.443999c0 5.598 4.595 10.443999 10.235 10.444h21.096998v21.096998c0 5.745 4.679 10.235999 10.444 10.236a10.443999 10.443999 0 0 0 10.443999-10.236v-21.096998h21.097999c5.744 0 10.234999-4.679 10.234999-10.444a10.443999 10.443999 0 0 0-10.234999-10.443999h-21.097999zM776.459955 960.861944H250.596985a20.804999 20.804999 0 0 1-20.825998-20.887999c0-11.529999 9.462999-20.888999 20.825998-20.888999h94.727995a83.009995 83.009995 0 0 1-11.112-41.671997v-605.969965a83.489995 83.489995 0 0 1 83.636996-83.447995h62.580996v-20.992999a83.489995 83.489995 0 0 1 83.636995-83.448995h501.151971a83.448995 83.448995 0 0 1 83.636995 83.448995v605.969965c0 15.184999-4.053 29.409998-11.134 41.671997h115.553994c11.551999 0 20.909999 9.273999 20.909998 20.887999 0 11.529999-9.295999 20.887999-20.888998 20.887999h-250.659986v20.992999c0 15.185999-4.052 29.409998-11.132999 41.671997h11.195999c11.488999 0 20.825999 9.274999 20.825999 20.888999 0 11.529999-9.462999 20.887999-20.825999 20.887999H892.807948a41.657998 41.657998 0 0 1-6.413 50.862997 41.671998 41.671998 0 0 1-59.071996 0l-50.862997-50.862997z m76.367995-41.776998h66.423996c22.977999 0 41.609998-18.589999 41.609998-41.879997V270.460984c0-22.559999-18.047999-40.689998-40.313998-40.689997H416.303976c-22.266999 0-40.314998 18.213999-40.314998 40.689997v606.741965c0 23.123999 18.799999 41.880998 41.589998 41.880997h317.083981l-10.736999-10.756999a41.692998 41.692998 0 0 1-10.862-40.376998l-19.718999-19.739999a146.259991 146.259991 0 0 1-190.980988-220.516987 146.217991 146.217991 0 0 1 220.517987 190.980989l19.738998 19.739999a41.629998 41.629998 0 0 1 40.376998 10.839999l69.829996 69.829996z m149.809991-104.440994h62.852997a41.796998 41.796998 0 0 0 41.589997-41.776997v-605.759965c0-23.144999-18.632999-41.776998-41.589997-41.776997H563.774967a41.796998 41.796998 0 0 0-41.566998 41.775997v20.888999h396.793977a83.448995 83.448995 0 0 1 83.636995 83.448995v543.199968zM266.326984 46.998997h31.122999c8.773999 0 15.875999 6.955 15.875999 15.665999 0 8.647999-7.102 15.665999-15.875999 15.665999h-31.122999v31.123999c0 8.772999-6.956 15.874999-15.665999 15.874999a15.769999 15.769999 0 0 1-15.666999-15.874999V78.329995H203.869988a15.728999 15.728999 0 0 1-15.874999-15.665999c0-8.647999 7.102-15.665999 15.874999-15.665999h31.122998V15.874999C234.992986 7.102 241.949986 0 250.659985 0c8.646999 0 15.665999 7.102 15.665999 15.874999V46.999997zM20.887999 939.973945c0-11.529999 9.462999-20.888999 20.825999-20.888999h125.454992c11.488999 0 20.825999 9.274999 20.825999 20.888999 0 11.529999-9.462999 20.887999-20.825999 20.887999H41.713998a20.804999 20.804999 0 0 1-20.825999-20.887999z m658.733961-135.021992A104.441994 104.441994 0 1 0 531.899969 657.229961a104.441994 104.441994 0 0 0 147.721991 147.721992z m-220.079987-491.626971a20.887999 20.887999 0 0 1 20.867999-20.888999h229.791986a20.887999 20.887999 0 1 1 0 41.776997H480.430972a20.825999 20.825999 0 0 1-20.887999-20.887998z m0 104.440994c0-11.529999 9.295999-20.887999 20.742999-20.887999H814.789952c11.446999 0 20.741999 9.273999 20.741999 20.887999 0 11.529999-9.294999 20.887999-20.741999 20.887998H480.284972a20.762999 20.762999 0 0 1-20.741999-20.887998z m0 104.441993c0-11.529999 9.316999-20.888999 20.846999-20.888998h146.301991c11.509999 0 20.845999 9.274999 20.845999 20.888998 0 11.529999-9.315999 20.887999-20.845999 20.887999H480.388972a20.804999 20.804999 0 0 1-20.845999-20.887999zM62.665996 396.877977a62.664996 62.664996 0 1 1 0-125.329993 62.664996 62.664996 0 0 1 0 125.329993z m0-31.332998a31.331998 31.331998 0 1 0 0-62.664997 31.331998 31.331998 0 0 0 0 62.664997z m1295.074924-93.996995a62.664996 62.664996 0 1 1 0-125.329993 62.664996 62.664996 0 0 1 0 125.329993z m0-31.332998a31.331998 31.331998 0 1 0 0-62.663996 31.331998 31.331998 0 0 0 0 62.663996z",
628
630
  "p-id": "4560"
629
631
  }, null, -1));
630
- const _hoisted_9 = [
631
- _hoisted_8
632
+ const _hoisted_9$2 = [
633
+ _hoisted_8$2
632
634
  ];
633
- const _hoisted_10 = { class: "file-upload-list-cover" };
634
- const _hoisted_11 = { class: "file-upload-btn" };
635
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
635
+ const _hoisted_10$2 = { class: "file-upload-list-cover" };
636
+ const _hoisted_11$2 = { class: "file-upload-btn" };
637
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
636
638
  const _component_Image = resolveComponent("Image");
637
639
  const _component_Icon = resolveComponent("Icon");
638
640
  const _component_Space = resolveComponent("Space");
@@ -640,7 +642,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
640
642
  const _component_Card = resolveComponent("Card");
641
643
  const _component_Spin = resolveComponent("Spin");
642
644
  const _component_filePreview = resolveComponent("filePreview");
643
- return openBlock(), createElementBlock("div", _hoisted_1, [
645
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
644
646
  !_ctx.single ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.groups, (groupName) => {
645
647
  return openBlock(), createBlock(_component_Card, {
646
648
  "dis-hover": "",
@@ -664,7 +666,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
664
666
  width: "100%",
665
667
  height: "100%"
666
668
  }, null, 8, ["src"]),
667
- createElementVNode("div", _hoisted_3, [
669
+ createElementVNode("div", _hoisted_3$2, [
668
670
  createVNode(_component_Space, null, {
669
671
  default: withCtx(() => [
670
672
  createVNode(_component_Icon, {
@@ -682,7 +684,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
682
684
  _: 2
683
685
  }, 1024)
684
686
  ])
685
- ], 8, _hoisted_2)
687
+ ], 8, _hoisted_2$2)
686
688
  ], 2);
687
689
  }), 256)),
688
690
  !_ctx.readonly ? (openBlock(), createBlock(_component_Upload, {
@@ -705,7 +707,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
705
707
  style: { "display": "inline-block", "width": "78px" }
706
708
  }, {
707
709
  default: withCtx(() => [
708
- createElementVNode("div", _hoisted_4, [
710
+ createElementVNode("div", _hoisted_4$2, [
709
711
  createVNode(_component_Icon, {
710
712
  type: "ios-camera",
711
713
  size: "20"
@@ -714,9 +716,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
714
716
  ]),
715
717
  _: 2
716
718
  }, 1032, ["multiple", "format", "max-size", "action", "headers", "data", "on-success", "on-format-error", "on-exceeded-size", "before-upload"])) : createCommentVNode("", true),
717
- _ctx.readonly && _ctx.fileList.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
718
- createElementVNode("i", _hoisted_6, [
719
- (openBlock(), createElementBlock("svg", _hoisted_7, _hoisted_9))
719
+ _ctx.readonly && _ctx.fileList.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
720
+ createElementVNode("i", _hoisted_6$2, [
721
+ (openBlock(), createElementBlock("svg", _hoisted_7$2, _hoisted_9$2))
720
722
  ]),
721
723
  createElementVNode("div", null, toDisplayString(_ctx.nullMsg), 1)
722
724
  ])) : createCommentVNode("", true)
@@ -744,7 +746,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
744
746
  width: "100%",
745
747
  height: "100%"
746
748
  }, null, 8, ["src"]),
747
- createElementVNode("div", _hoisted_10, [
749
+ createElementVNode("div", _hoisted_10$2, [
748
750
  createVNode(_component_Space, null, {
749
751
  default: withCtx(() => [
750
752
  createVNode(_component_Icon, {
@@ -787,7 +789,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
787
789
  style: { "display": "inline-block", "width": "78px" }
788
790
  }, {
789
791
  default: withCtx(() => [
790
- createElementVNode("div", _hoisted_11, [
792
+ createElementVNode("div", _hoisted_11$2, [
791
793
  createVNode(_component_Icon, {
792
794
  type: "ios-camera",
793
795
  size: "20"
@@ -813,7 +815,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
813
815
  }, null, 8, ["modelValue", "preview-list", "preview-index", "file-info"])
814
816
  ]);
815
817
  }
816
- const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-d6b14e55"]]);
818
+ const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-d6b14e55"]]);
817
819
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
818
820
  function getDefaultExportFromCjs(x) {
819
821
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -15145,7 +15147,7 @@ const QuillEditor = defineComponent({
15145
15147
  });
15146
15148
  const vueQuill_snow = "";
15147
15149
  const vueQuill_bubble = "";
15148
- const propDefine$1 = {
15150
+ const propDefine$4 = {
15149
15151
  modelValue: {
15150
15152
  default: "",
15151
15153
  type: String
@@ -15163,14 +15165,14 @@ const propDefine$1 = {
15163
15165
  default: true
15164
15166
  }
15165
15167
  };
15166
- const _sfc_main$1 = defineComponent({
15168
+ const _sfc_main$4 = defineComponent({
15167
15169
  name: "TextEditor",
15168
15170
  components: {
15169
15171
  QuillEditor
15170
15172
  },
15171
15173
  emits: ["update:modelValue", "textChange"],
15172
15174
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
15173
- props: propDefine$1,
15175
+ props: propDefine$4,
15174
15176
  setup(props, ctx) {
15175
15177
  return new TextEditor$1(props, ctx);
15176
15178
  }
@@ -15289,7 +15291,7 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
15289
15291
  //#endregion 业务逻辑 END
15290
15292
  };
15291
15293
  const TextEditor_vue_vue_type_style_index_0_scoped_5812cc0f_lang = "";
15292
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
15294
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
15293
15295
  const _component_QuillEditor = resolveComponent("QuillEditor");
15294
15296
  return openBlock(), createElementBlock("div", {
15295
15297
  style: { "height": "100%" },
@@ -15308,8 +15310,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
15308
15310
  }, null, 8, ["content", "readOnly", "theme", "onTextChange", "options"])) : createCommentVNode("", true)
15309
15311
  ], 2);
15310
15312
  }
15311
- const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-5812cc0f"]]);
15312
- const propDefine = {
15313
+ const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-5812cc0f"]]);
15314
+ const propDefine$3 = {
15313
15315
  onlyView: {
15314
15316
  // 是否只读
15315
15317
  type: Boolean,
@@ -15327,11 +15329,11 @@ const propDefine = {
15327
15329
  }
15328
15330
  }
15329
15331
  };
15330
- const _sfc_main = defineComponent({
15332
+ const _sfc_main$3 = defineComponent({
15331
15333
  name: "NvComFormUp",
15332
15334
  components: { UploadFile, TextEditor: TextEditor2, NvDicSelect, NvStructureTypeSelect, NvStructureSelect },
15333
15335
  emits: ["textChange", "TokenChange"],
15334
- props: propDefine,
15336
+ props: propDefine$3,
15335
15337
  setup(props, ctx) {
15336
15338
  return new ComFormInstance(props, ctx);
15337
15339
  }
@@ -15410,7 +15412,7 @@ class ComFormInstance extends BaseInstance {
15410
15412
  this.ctx = ctx;
15411
15413
  }
15412
15414
  }
15413
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
15415
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
15414
15416
  const _component_UploadFile = resolveComponent("UploadFile");
15415
15417
  const _component_TextEditor = resolveComponent("TextEditor");
15416
15418
  const _component_NvDicSelect = resolveComponent("NvDicSelect");
@@ -15465,10 +15467,938 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
15465
15467
  _: 1
15466
15468
  }, 8, ["onlyView", "formItems", "formModel"]);
15467
15469
  }
15468
- const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
15470
+ const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
15471
+ const propDefine$2 = {
15472
+ code: {
15473
+ // 字典码
15474
+ type: String,
15475
+ default: ""
15476
+ },
15477
+ platformId: {
15478
+ // 平台Id
15479
+ type: Number,
15480
+ default: null
15481
+ },
15482
+ value: {
15483
+ // 平台Id
15484
+ type: String,
15485
+ default: ""
15486
+ },
15487
+ readonly: {
15488
+ // 只读
15489
+ type: Boolean,
15490
+ default: false
15491
+ }
15492
+ };
15493
+ const _sfc_main$2 = defineComponent({
15494
+ name: "NvDicSelect",
15495
+ components: {},
15496
+ emits: ["input", "change"],
15497
+ // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
15498
+ props: propDefine$2,
15499
+ setup(props, ctx) {
15500
+ return new DicSelectInstance(props, ctx);
15501
+ }
15502
+ });
15503
+ class DicSelectInstance extends BaseInstance {
15504
+ constructor(props, ctx) {
15505
+ super();
15506
+ __publicField(this, "props");
15507
+ __publicField(this, "ctx");
15508
+ // 全局属性
15509
+ __publicField(this, "DicValue", ref(""));
15510
+ __publicField(this, "dicOptions", ref([]));
15511
+ __publicField(this, "DicSelectChange", () => {
15512
+ this.ctx.emit("input", this.DicValue.value);
15513
+ this.ctx.emit("change", this.DicValue.value);
15514
+ });
15515
+ this.props = props;
15516
+ this.ctx = ctx;
15517
+ this.loadDicData();
15518
+ }
15519
+ async loadDicData() {
15520
+ this.dicOptions.value = await loadDictionaryData(this.props.code, [], true, this.props.platformId);
15521
+ }
15522
+ }
15523
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
15524
+ const _component_Option = resolveComponent("Option");
15525
+ const _component_Select = resolveComponent("Select");
15526
+ return openBlock(), createBlock(_component_Select, {
15527
+ disabled: _ctx.readonly,
15528
+ modelValue: _ctx.DicValue,
15529
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.DicValue = $event),
15530
+ transfer: "",
15531
+ onOnChange: _ctx.DicSelectChange
15532
+ }, {
15533
+ default: withCtx(() => [
15534
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dicOptions, (item) => {
15535
+ return openBlock(), createBlock(_component_Option, {
15536
+ value: item.value,
15537
+ key: item.value
15538
+ }, {
15539
+ default: withCtx(() => [
15540
+ createTextVNode(toDisplayString(item.text), 1)
15541
+ ]),
15542
+ _: 2
15543
+ }, 1032, ["value"]);
15544
+ }), 128))
15545
+ ]),
15546
+ _: 1
15547
+ }, 8, ["disabled", "modelValue", "onOnChange"]);
15548
+ }
15549
+ const NvDicSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
15550
+ const propDefine$1 = {
15551
+ // modelValue:{
15552
+ // // 平台Id
15553
+ // type: Array,
15554
+ // default: []
15555
+ // },
15556
+ readonly: {
15557
+ // 只读
15558
+ type: Boolean,
15559
+ default: false
15560
+ },
15561
+ multiple: {
15562
+ // 是否多选
15563
+ type: Boolean,
15564
+ default: false
15565
+ },
15566
+ dataValue: {
15567
+ // 值
15568
+ type: Array || Number,
15569
+ default: true
15570
+ }
15571
+ };
15572
+ const _sfc_main$1 = defineComponent({
15573
+ name: "NvStructureTypeSelect",
15574
+ components: {},
15575
+ emits: ["update", "on-change"],
15576
+ // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
15577
+ props: propDefine$1,
15578
+ setup(props, ctx) {
15579
+ return new StructureTypeSelectInstance(props, ctx);
15580
+ }
15581
+ });
15582
+ class StructureTypeSelectInstance extends BaseInstance {
15583
+ constructor(props, ctx) {
15584
+ super();
15585
+ __publicField(this, "props");
15586
+ __publicField(this, "ctx");
15587
+ // 全局属性
15588
+ __publicField(this, "selWidth", ref(100));
15589
+ __publicField(this, "StructureTypeSel", ref());
15590
+ __publicField(this, "TypeValue", ref([]));
15591
+ __publicField(this, "StructureTypeDataAll", []);
15592
+ __publicField(this, "StructureTypeData", ref([]));
15593
+ __publicField(this, "StructureTypeCheckData", ref([]));
15594
+ __publicField(this, "searchView", ref(false));
15595
+ __publicField(this, "searchValue", ref(""));
15596
+ /**
15597
+ * 获取构件类别列表数据
15598
+ */
15599
+ __publicField(this, "dataStructureApi", new DataStructureApi());
15600
+ __publicField(this, "structrueTypeLevGroup", ref([]));
15601
+ __publicField(this, "activeTypeItem", ref({}));
15602
+ __publicField(this, "TypeTextValue", ref(""));
15603
+ __publicField(this, "typeItemClick", (item, level) => {
15604
+ item.level = level;
15605
+ if (level == 1) {
15606
+ this.activeTypeItem.value = item;
15607
+ }
15608
+ if (this.structrueTypeLevGroup.value.find((e) => e["level"] == level)) {
15609
+ let index = linq.from(this.structrueTypeLevGroup.value).indexOf((e) => e["level"] == level);
15610
+ this.structrueTypeLevGroup.value[index] = item;
15611
+ this.structrueTypeLevGroup.value.splice(index + 1, this.structrueTypeLevGroup.value.length);
15612
+ } else {
15613
+ this.structrueTypeLevGroup.value.push(item);
15614
+ }
15615
+ nextTick(() => {
15616
+ if (this.StructureTypeSel.value) {
15617
+ let boxWidth = this.StructureTypeSel.value.clientWidth;
15618
+ this.selWidth.value = parseFloat(boxWidth);
15619
+ }
15620
+ });
15621
+ this.TypeValue.value = [this.activeTypeItem.value.value].concat(this.structrueTypeLevGroup.value.map((e) => e["value"]));
15622
+ if (!this.props.multiple) {
15623
+ this.StructureTypeCheckData.value = [item];
15624
+ this.doSelectedAfterFun();
15625
+ }
15626
+ });
15627
+ __publicField(this, "typeCheckFun", (item, state) => {
15628
+ if (state) {
15629
+ this.StructureTypeCheckData.value.push(item);
15630
+ } else {
15631
+ let index = linq.from(this.StructureTypeCheckData.value).indexOf((e) => e["value"] == item.value);
15632
+ this.StructureTypeCheckData.value.splice(index, 1);
15633
+ }
15634
+ this.doSelectedAfterFun();
15635
+ });
15636
+ __publicField(this, "removeStructureType", (item) => {
15637
+ this.changeTreeItem(this.StructureTypeData.value, item.value, "checked", false);
15638
+ let index = linq.from(this.StructureTypeCheckData.value).indexOf((e) => e["value"] == item.value);
15639
+ this.StructureTypeCheckData.value.splice(index, 1);
15640
+ });
15641
+ __publicField(this, "poptipVisChange", () => {
15642
+ nextTick(() => {
15643
+ if (this.StructureTypeSel.value) {
15644
+ let boxWidth = this.StructureTypeSel.value.clientWidth;
15645
+ this.selWidth.value = parseFloat(boxWidth);
15646
+ }
15647
+ });
15648
+ });
15649
+ __publicField(this, "poptipHideFun", () => {
15650
+ if (this.searchValue.value && this.searchTypeList.value.length == 0) {
15651
+ this.searchView.value = false;
15652
+ this.searchValue.value = "";
15653
+ }
15654
+ });
15655
+ __publicField(this, "searchTypeList", ref([]));
15656
+ __publicField(this, "searchTypeFun", () => {
15657
+ let res = this.StructureTypeDataAll.filter((e) => e["NodeName"].indexOf(this.searchValue.value) >= 0);
15658
+ this.searchTypeList.value = res.map((e) => {
15659
+ e.checked = this.StructureTypeCheckData.value.find((x) => x["value"] == e.Id) ? true : false;
15660
+ return e;
15661
+ });
15662
+ nextTick(() => {
15663
+ if (this.StructureTypeSel.value) {
15664
+ let boxWidth = this.StructureTypeSel.value.clientWidth;
15665
+ this.selWidth.value = parseFloat(boxWidth) + 16;
15666
+ }
15667
+ });
15668
+ });
15669
+ __publicField(this, "toSelectSearchType", (item) => {
15670
+ this.TypeValue.value = item.parentPath.concat([item.Id]);
15671
+ this.StructureTypeCheckData.value = [{ value: item.Id, label: item.NodeName, parentPath: item.parentPath }];
15672
+ this.doSelectedAfterFun();
15673
+ this.structrueTypeLevGroup.value = [];
15674
+ this.loadTypeLevGroupData(this.StructureTypeData.value);
15675
+ this.poptipVisChange();
15676
+ this.searchValue.value = "";
15677
+ this.searchView.value = false;
15678
+ this.searchTypeList.value = [];
15679
+ });
15680
+ __publicField(this, "toCheckSearchType", (item, state) => {
15681
+ let index = linq.from(this.StructureTypeCheckData.value).indexOf((e) => e["value"] == item.value);
15682
+ if (state || index >= 0) {
15683
+ this.StructureTypeCheckData.value.push({ value: item.Id, label: item.NodeName, parentPath: item.parentPath });
15684
+ this.changeTreeItem(this.StructureTypeData.value, item.Id, "checked", true);
15685
+ } else {
15686
+ this.StructureTypeCheckData.value.splice(index, 1);
15687
+ this.changeTreeItem(this.StructureTypeData.value, item.Id, "checked", false);
15688
+ }
15689
+ });
15690
+ __publicField(this, "confirmSearchTypeData", () => {
15691
+ this.doSelectedAfterFun();
15692
+ this.searchValue.value = "";
15693
+ this.searchView.value = false;
15694
+ this.structrueTypeLevGroup.value = [];
15695
+ this.searchTypeList.value = [];
15696
+ this.poptipVisChange();
15697
+ });
15698
+ this.props = props;
15699
+ this.ctx = ctx;
15700
+ this.loadSelectData();
15701
+ }
15702
+ async loadSelectData() {
15703
+ let res = window["G_StructureTypeData"];
15704
+ if (!res || res.length == 0) {
15705
+ res = this.utilities.parseApiResult(await this.dataStructureApi.getEntities(new QueryWrapper().select(["Id", "PId", "NodeName"]).orderBy(["OrderNo"])));
15706
+ window["G_StructureTypeData"] = res;
15707
+ }
15708
+ this.StructureTypeDataAll = res;
15709
+ this.StructureTypeData.value = this.formatToIViewCascaderData(res, 0, "Id", "NodeName");
15710
+ if (!this.props.multiple) {
15711
+ this.loadTypeLevGroupData(this.StructureTypeData.value);
15712
+ }
15713
+ watch(() => this.props.dataValue, (newValue, oldValue) => {
15714
+ this.setStructureTypeCheckData(this.StructureTypeData.value);
15715
+ if (!this.props.multiple) {
15716
+ this.structrueTypeLevGroup.value = [];
15717
+ this.loadTypeLevGroupData(this.StructureTypeData.value);
15718
+ }
15719
+ }, { immediate: true });
15720
+ }
15721
+ /**
15722
+ * 展开选中值所在的列表
15723
+ * @param data
15724
+ */
15725
+ loadTypeLevGroupData(data) {
15726
+ data.map((e) => {
15727
+ if (this.StructureTypeCheckData.value[0]) {
15728
+ let parentPath = this.StructureTypeCheckData.value[0].parentPath;
15729
+ if (parentPath.includes(e.value)) {
15730
+ this.structrueTypeLevGroup.value.push(e);
15731
+ }
15732
+ if (e.children && e.children.length > 0) {
15733
+ this.loadTypeLevGroupData(e.children);
15734
+ }
15735
+ }
15736
+ });
15737
+ }
15738
+ /**
15739
+ * 执行选择项发生改变后事件
15740
+ */
15741
+ doSelectedAfterFun() {
15742
+ if (this.props.multiple) {
15743
+ this.ctx.emit("on-change", this.StructureTypeCheckData.value.map((e) => e["value"]));
15744
+ } else {
15745
+ this.ctx.emit("on-change", this.StructureTypeCheckData.value[0].value);
15746
+ }
15747
+ }
15748
+ /**
15749
+ * 转换为iview级联菜单所需数据
15750
+ * @param data 原始数据
15751
+ * @param PId
15752
+ * @param value
15753
+ * @param label
15754
+ * @returns
15755
+ */
15756
+ formatToIViewCascaderData(data, PId = 0, value, label, parentPath = []) {
15757
+ let arr1 = data.filter((e) => e["PId"] == PId);
15758
+ let parentPath2 = JSON.parse(JSON.stringify(parentPath));
15759
+ if (PId > 0) {
15760
+ parentPath2.push(PId);
15761
+ }
15762
+ arr1 = arr1.map((e) => {
15763
+ let obj = {};
15764
+ obj.value = e[value];
15765
+ obj.label = e[label];
15766
+ obj.parentPath = JSON.parse(JSON.stringify(parentPath2));
15767
+ let index = linq.from(this.StructureTypeDataAll).indexOf((x) => x["Id"] == obj.value);
15768
+ this.StructureTypeDataAll[index].parentPath = obj.parentPath;
15769
+ obj.level = obj.parentPath.length + 1;
15770
+ if (this.props.multiple) {
15771
+ obj.checked = this.props.dataValue.find((x) => x == obj.value) ? true : false;
15772
+ if (obj.checked) {
15773
+ this.StructureTypeCheckData.value.push(obj);
15774
+ }
15775
+ } else {
15776
+ if (this.props.dataValue == obj.value) {
15777
+ this.TypeValue.value = JSON.parse(JSON.stringify(parentPath2)).concat([obj.value]);
15778
+ this.StructureTypeCheckData.value = [obj];
15779
+ }
15780
+ }
15781
+ let data2 = data.filter((x) => x["PId"] == e.Id);
15782
+ if (data2.length > 0) {
15783
+ obj.children = this.formatToIViewCascaderData(data, e.Id, value, label, parentPath2);
15784
+ } else {
15785
+ obj.children = [];
15786
+ }
15787
+ return obj;
15788
+ });
15789
+ return arr1;
15790
+ }
15791
+ setStructureTypeCheckData(data) {
15792
+ data.map((e) => {
15793
+ if (this.props.multiple) {
15794
+ e.checked = this.props.dataValue.find((x) => x == e.value) ? true : false;
15795
+ if (e.checked) {
15796
+ this.StructureTypeCheckData.value.push(e);
15797
+ }
15798
+ } else {
15799
+ if (this.props.dataValue == e.value) {
15800
+ this.TypeValue.value = JSON.parse(JSON.stringify(e.parentPath)).concat([e.value]);
15801
+ this.StructureTypeCheckData.value = [e];
15802
+ }
15803
+ }
15804
+ if (e.children && e.children.length > 0) {
15805
+ this.setStructureTypeCheckData(e.children);
15806
+ }
15807
+ });
15808
+ }
15809
+ changeTreeItem(data, Id, key, value) {
15810
+ data.map((e) => {
15811
+ if (e.value == Id) {
15812
+ e[key] = value;
15813
+ return;
15814
+ }
15815
+ if (e.children && e.children.length > 0) {
15816
+ this.changeTreeItem(e.children, Id, key, value);
15817
+ }
15818
+ });
15819
+ }
15820
+ }
15821
+ const StructureTypeSelect_vue_vue_type_style_index_0_scoped_c07822d5_lang = "";
15822
+ const StructureTypeSelect_vue_vue_type_style_index_1_lang = "";
15823
+ const _hoisted_1$1 = { key: 0 };
15824
+ const _hoisted_2$1 = {
15825
+ key: 0,
15826
+ ref: "StructureTypeSel",
15827
+ style: { "height": "220px", "display": "inline-block" }
15828
+ };
15829
+ const _hoisted_3$1 = { class: "nv-cascader-box nv-overflow-auto" };
15830
+ const _hoisted_4$1 = ["onClick"];
15831
+ const _hoisted_5$1 = {
15832
+ key: 0,
15833
+ class: "nv-cascader-box nv-overflow-auto"
15834
+ };
15835
+ const _hoisted_6$1 = ["onClick"];
15836
+ const _hoisted_7$1 = {
15837
+ key: 1,
15838
+ ref: "StructureTypeSel",
15839
+ style: { "display": "inline-block" }
15840
+ };
15841
+ const _hoisted_8$1 = {
15842
+ key: 0,
15843
+ style: { "padding": "5px 10px", "color": "#c5c8ce", "text-align": "center", "width": "150px" }
15844
+ };
15845
+ const _hoisted_9$1 = { key: 1 };
15846
+ const _hoisted_10$1 = {
15847
+ class: "nv-overflow-auto",
15848
+ style: { "max-height": "220px" }
15849
+ };
15850
+ const _hoisted_11$1 = ["onClick"];
15851
+ const _hoisted_12$1 = {
15852
+ key: 0,
15853
+ class: "nv-text-r",
15854
+ style: { "padding-right": "10px" }
15855
+ };
15856
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
15857
+ const _component_Tag = resolveComponent("Tag");
15858
+ const _component_Checkbox = resolveComponent("Checkbox");
15859
+ const _component_Icon = resolveComponent("Icon");
15860
+ const _component_Button = resolveComponent("Button");
15861
+ const _component_Poptip = resolveComponent("Poptip");
15862
+ return openBlock(), createElementBlock("div", null, [
15863
+ createVNode(_component_Poptip, {
15864
+ placement: "bottom-start",
15865
+ "transfer-class-name": "nvstructuretype-sel-box",
15866
+ width: _ctx.selWidth,
15867
+ transfer: "",
15868
+ disabled: _ctx.readonly,
15869
+ onOnPopperShow: _cache[6] || (_cache[6] = ($event) => _ctx.poptipVisChange()),
15870
+ onOnPopperHide: _ctx.poptipHideFun
15871
+ }, {
15872
+ content: withCtx(() => [
15873
+ !_ctx.searchValue ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
15874
+ createElementVNode("div", _hoisted_3$1, [
15875
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.StructureTypeData, (item) => {
15876
+ return openBlock(), createElementBlock("div", {
15877
+ class: normalizeClass(["nv-c-p nv-cascader-item", { active: _ctx.TypeValue.includes(item.value) }]),
15878
+ key: item.value,
15879
+ onClick: ($event) => _ctx.typeItemClick(item, 1)
15880
+ }, [
15881
+ _ctx.multiple ? (openBlock(), createBlock(_component_Checkbox, {
15882
+ key: 0,
15883
+ modelValue: item.checked,
15884
+ "onUpdate:modelValue": ($event) => item.checked = $event,
15885
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {
15886
+ }, ["stop"])),
15887
+ onOnChange: ($event) => _ctx.typeCheckFun(item, $event)
15888
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange"])) : createCommentVNode("", true),
15889
+ createTextVNode(" " + toDisplayString(item.label) + " ", 1),
15890
+ item.children && item.children.length > 0 ? (openBlock(), createBlock(_component_Icon, {
15891
+ key: 1,
15892
+ class: "arrow-right",
15893
+ type: "ios-arrow-forward"
15894
+ })) : createCommentVNode("", true)
15895
+ ], 10, _hoisted_4$1);
15896
+ }), 128))
15897
+ ]),
15898
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.structrueTypeLevGroup, (item1) => {
15899
+ return openBlock(), createElementBlock(Fragment, null, [
15900
+ item1 && item1.children && item1.children.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
15901
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item1.children, (item2) => {
15902
+ return openBlock(), createElementBlock("div", {
15903
+ class: normalizeClass(["nv-c-p nv-cascader-item", { active: _ctx.TypeValue.includes(item2.value) }]),
15904
+ key: item2.value,
15905
+ onClick: ($event) => _ctx.typeItemClick(item2, item1.level + 1)
15906
+ }, [
15907
+ _ctx.multiple ? (openBlock(), createBlock(_component_Checkbox, {
15908
+ key: 0,
15909
+ modelValue: item2.checked,
15910
+ "onUpdate:modelValue": ($event) => item2.checked = $event,
15911
+ onClick: _cache[4] || (_cache[4] = withModifiers(() => {
15912
+ }, ["stop"])),
15913
+ onOnChange: ($event) => _ctx.typeCheckFun(item2, $event)
15914
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange"])) : createCommentVNode("", true),
15915
+ createTextVNode(" " + toDisplayString(item2.label) + " ", 1),
15916
+ item2.children && item2.children.length > 0 ? (openBlock(), createBlock(_component_Icon, {
15917
+ key: 1,
15918
+ class: "arrow-right",
15919
+ type: "ios-arrow-forward"
15920
+ })) : createCommentVNode("", true)
15921
+ ], 10, _hoisted_6$1);
15922
+ }), 128))
15923
+ ])) : createCommentVNode("", true)
15924
+ ], 64);
15925
+ }), 256))
15926
+ ], 512)) : (openBlock(), createElementBlock("div", _hoisted_7$1, [
15927
+ _ctx.searchTypeList.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, "无匹配数据")) : (openBlock(), createElementBlock("div", _hoisted_9$1, [
15928
+ createElementVNode("div", _hoisted_10$1, [
15929
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.searchTypeList, (item, index) => {
15930
+ return openBlock(), createElementBlock("div", {
15931
+ class: "nv-cascader-item nv-c-p",
15932
+ onClick: ($event) => _ctx.multiple ? null : _ctx.toSelectSearchType(item)
15933
+ }, [
15934
+ _ctx.multiple ? (openBlock(), createBlock(_component_Checkbox, {
15935
+ key: 0,
15936
+ modelValue: item.checked,
15937
+ "onUpdate:modelValue": ($event) => item.checked = $event,
15938
+ onClick: _cache[5] || (_cache[5] = withModifiers(() => {
15939
+ }, ["stop"])),
15940
+ onOnChange: ($event) => _ctx.toCheckSearchType(item, $event)
15941
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange"])) : createCommentVNode("", true),
15942
+ createTextVNode(" " + toDisplayString(item.NodeName), 1)
15943
+ ], 8, _hoisted_11$1);
15944
+ }), 256))
15945
+ ]),
15946
+ _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
15947
+ createVNode(_component_Button, {
15948
+ type: "primary",
15949
+ size: "small",
15950
+ onClick: _ctx.confirmSearchTypeData
15951
+ }, {
15952
+ default: withCtx(() => [
15953
+ createTextVNode("确认")
15954
+ ]),
15955
+ _: 1
15956
+ }, 8, ["onClick"])
15957
+ ])) : createCommentVNode("", true)
15958
+ ]))
15959
+ ], 512))
15960
+ ]),
15961
+ default: withCtx(() => [
15962
+ createElementVNode("div", {
15963
+ class: "nv-c-p structuretype-sel-box",
15964
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.readonly ? null : _ctx.searchView = true)
15965
+ }, [
15966
+ _ctx.StructureTypeCheckData.length == 0 && !_ctx.searchValue ? (openBlock(), createElementBlock("div", _hoisted_1$1, "选择构件类别")) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
15967
+ _ctx.multiple ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.StructureTypeCheckData, (item, index) => {
15968
+ return withDirectives((openBlock(), createBlock(_component_Tag, {
15969
+ style: { "position": "relative", "z-index": "5" },
15970
+ closable: !_ctx.readonly,
15971
+ key: index,
15972
+ onOnClose: ($event) => _ctx.removeStructureType(item)
15973
+ }, {
15974
+ default: withCtx(() => [
15975
+ createTextVNode(toDisplayString(item.label), 1)
15976
+ ]),
15977
+ _: 2
15978
+ }, 1032, ["closable", "onOnClose"])), [
15979
+ [vShow, !_ctx.searchValue]
15980
+ ]);
15981
+ }), 128)) : (openBlock(), createElementBlock("div", {
15982
+ key: 1,
15983
+ style: normalizeStyle({ visibility: _ctx.searchValue ? "hidden" : "visible" }),
15984
+ class: "nv-text-nowrap"
15985
+ }, toDisplayString(_ctx.StructureTypeCheckData[0] ? _ctx.StructureTypeCheckData[0].label : ""), 5))
15986
+ ], 64)),
15987
+ _ctx.searchView ? withDirectives((openBlock(), createElementBlock("input", {
15988
+ key: 2,
15989
+ class: "nv-pos-a searchinput",
15990
+ style: { "top": "0", "left": "0", "width": "100%" },
15991
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.searchValue = $event),
15992
+ onInput: _cache[1] || (_cache[1] = (...args) => _ctx.searchTypeFun && _ctx.searchTypeFun(...args))
15993
+ }, null, 544)), [
15994
+ [vModelText, _ctx.searchValue]
15995
+ ]) : createCommentVNode("", true)
15996
+ ])
15997
+ ]),
15998
+ _: 1
15999
+ }, 8, ["width", "disabled", "onOnPopperHide"])
16000
+ ]);
16001
+ }
16002
+ const NvStructureTypeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-c07822d5"]]);
16003
+ const propDefine = {
16004
+ readonly: {
16005
+ // 只读
16006
+ type: Boolean,
16007
+ default: false
16008
+ },
16009
+ selType: {
16010
+ // 选择类别
16011
+ type: Number,
16012
+ default: 1
16013
+ },
16014
+ multiple: {
16015
+ // 是否多选
16016
+ type: Boolean,
16017
+ default: true
16018
+ },
16019
+ dataValue: {
16020
+ // 值
16021
+ type: Array || Number,
16022
+ default: true
16023
+ }
16024
+ };
16025
+ const _sfc_main = defineComponent({
16026
+ name: "NvStructureSelect",
16027
+ components: {},
16028
+ emits: ["update", "on-change"],
16029
+ // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
16030
+ props: propDefine,
16031
+ setup(props, ctx) {
16032
+ return new StructureSelectInstance(props, ctx);
16033
+ }
16034
+ });
16035
+ class StructureSelectInstance extends BaseInstance {
16036
+ constructor(props, ctx) {
16037
+ super();
16038
+ __publicField(this, "props");
16039
+ __publicField(this, "ctx");
16040
+ // 全局属性
16041
+ __publicField(this, "TypeValue", ref([]));
16042
+ __publicField(this, "StructureTypeData", ref([]));
16043
+ /**
16044
+ * 获取构件类别列表数据
16045
+ */
16046
+ __publicField(this, "dataStructureApi", new DataStructureApi());
16047
+ __publicField(this, "structureInstanceApi", new StructureInstanceApi());
16048
+ /** 单位工程下拉列表值 */
16049
+ __publicField(this, "UnitValue", ref());
16050
+ __publicField(this, "TypeGroupData", ref([]));
16051
+ __publicField(this, "activeNodeType", ref(""));
16052
+ //#region 构件选择--单位工程列表相关
16053
+ __publicField(this, "activeUnit", ref(0));
16054
+ __publicField(this, "activeUnitName", "");
16055
+ __publicField(this, "unitData", ref([]));
16056
+ /**
16057
+ * 顶级构件类别选择事件
16058
+ */
16059
+ __publicField(this, "NodeTypeSelect", () => {
16060
+ this.unitData.value = this.TypeGroupData.value.find((e) => e["NodeTypeName"] == this.activeNodeType.value).UnitData;
16061
+ if (this.props.selType == 1 && this.props.multiple) {
16062
+ return;
16063
+ }
16064
+ if (this.unitData.value[0]) {
16065
+ this.activeUnit.value = this.unitData.value[0].Id;
16066
+ this.activeUnitName = this.unitData.value[0].NodeName;
16067
+ this.unitSelected(this.activeUnit.value);
16068
+ }
16069
+ });
16070
+ //#endregion
16071
+ //#region 构件选择--构件树列表数据相关
16072
+ __publicField(this, "StructureInstanceLoading", ref(false));
16073
+ __publicField(this, "StructureInstanceData", ref([]));
16074
+ /**
16075
+ * 构件树根节点数据获取
16076
+ * @param value 单位工程Id
16077
+ */
16078
+ __publicField(this, "unitSelected", async (value) => {
16079
+ this.activeUnitName = this.unitData.value.find((e) => e["Id"] == value).NodeName;
16080
+ this.StructureInstanceLoading.value = true;
16081
+ this.StructureInstanceData.value = [];
16082
+ let res = this.utilities.parseApiResult(await this.structureInstanceApi.getEntities(new QueryWrapper().select(["Id", "NodeTypeName", "NodeType", "NodeName"]).eq("PId", value)));
16083
+ this.StructureInstanceData.value = res.map((e) => {
16084
+ e.title = e.NodeName;
16085
+ e.UnitName = this.activeUnitName;
16086
+ e.loading = false;
16087
+ e.checked = this.StructureInstanceCheckData.value.find((x) => x["Id"] == e.Id) ? true : false;
16088
+ e.children = [];
16089
+ return e;
16090
+ });
16091
+ this.StructureInstanceLoading.value = false;
16092
+ });
16093
+ /**
16094
+ * 构件树子级数据获取
16095
+ * @param item
16096
+ * @param callback
16097
+ * @returns
16098
+ */
16099
+ __publicField(this, "loadStructureInstance", async (item, callback) => {
16100
+ let res = this.utilities.parseApiResult(await this.structureInstanceApi.getEntities(new QueryWrapper().select(["Id", "NodeTypeName", "NodeType", "NodeName"]).eq("PId", item.Id)));
16101
+ if (res.length == 0) {
16102
+ item.children = void 0;
16103
+ callback([]);
16104
+ return;
16105
+ }
16106
+ res = res.map((e) => {
16107
+ e.title = e.NodeName;
16108
+ e.loading = false;
16109
+ e.checked = this.StructureInstanceCheckData.value.find((x) => x["Id"] == e.Id) ? true : false;
16110
+ e.children = [];
16111
+ return e;
16112
+ });
16113
+ callback(res);
16114
+ });
16115
+ /** 已选择构件数据 */
16116
+ __publicField(this, "StructureInstanceCheckData", ref([]));
16117
+ /**
16118
+ * 构件复选框选中
16119
+ * @param nodes
16120
+ * @param item
16121
+ */
16122
+ __publicField(this, "StructureInstanceCheckFun", (nodes, item) => {
16123
+ if (item.checked) {
16124
+ this.StructureInstanceCheckData.value.push(item);
16125
+ } else {
16126
+ this.removeStructureInstance(item);
16127
+ }
16128
+ this.doSelectedAfterFun();
16129
+ });
16130
+ __publicField(this, "StructureInstanceSelectFun", (nodes, item) => {
16131
+ if (!this.props.multiple) {
16132
+ this.StructureInstanceCheckData.value = [item];
16133
+ this.doSelectedAfterFun();
16134
+ }
16135
+ });
16136
+ /**
16137
+ * 移除选中构件
16138
+ * @param item
16139
+ */
16140
+ __publicField(this, "removeStructureInstance", (item) => {
16141
+ item.checked = false;
16142
+ let index = linq.from(this.StructureInstanceCheckData.value).indexOf((e) => e["Id"] == item.Id);
16143
+ this.StructureInstanceCheckData.value.splice(index, 1);
16144
+ this.treeChStateChange(this.StructureInstanceData.value);
16145
+ this.doSelectedAfterFun();
16146
+ });
16147
+ this.props = props;
16148
+ this.ctx = ctx;
16149
+ this.loadNodeTypeAndUnitData();
16150
+ }
16151
+ /**
16152
+ * 获取构件类别大类及单位工程数据
16153
+ */
16154
+ async loadNodeTypeAndUnitData() {
16155
+ let res = this.utilities.parseApiResult(await this.structureInstanceApi.getEntities(new QueryWrapper().select(["Id", "NodeTypeName", "NodeType", "NodeName"]).eq("PId", 0)));
16156
+ this.TypeGroupData.value = linq.from(res).groupBy((e) => e["NodeTypeName"]).select((e) => {
16157
+ return {
16158
+ NodeTypeName: e.key(),
16159
+ UnitData: e.getSource()
16160
+ };
16161
+ }).toArray();
16162
+ if (this.props.selType == 1) {
16163
+ this.UnitValue.value = this.props.dataValue;
16164
+ return;
16165
+ }
16166
+ if (this.TypeGroupData.value[0]) {
16167
+ this.activeNodeType.value = this.TypeGroupData.value[0].NodeTypeName;
16168
+ this.NodeTypeSelect();
16169
+ if (this.props.dataValue) {
16170
+ let ids = typeof this.props.dataValue == "object" ? this.props.dataValue : [this.props.dataValue];
16171
+ this.StructureInstanceCheckData.value = this.utilities.parseApiResult(await this.structureInstanceApi.getEntities(new QueryWrapper().select(["Id", "NodeTypeName", "NodeType", "NodeName", "RootId"]).in("Id", ids)));
16172
+ this.StructureInstanceCheckData.value = this.StructureInstanceCheckData.value.map((e) => {
16173
+ let unitInfo = this.unitData.value.find((x) => x["Id"] == e.RootId);
16174
+ e.UnitName = unitInfo ? unitInfo.NodeName : "";
16175
+ return e;
16176
+ });
16177
+ }
16178
+ }
16179
+ }
16180
+ /**
16181
+ * 单位工程选择项改变事件
16182
+ */
16183
+ unitSelectChange() {
16184
+ this.doSelectedAfterFun();
16185
+ }
16186
+ /**
16187
+ * 变更树组件选中状态
16188
+ * @param data
16189
+ */
16190
+ treeChStateChange(data) {
16191
+ data.map((e) => {
16192
+ e.checked = this.StructureInstanceCheckData.value.find((x) => x["Id"] == e.Id) ? true : false;
16193
+ if (e.children && e.children.length > 0) {
16194
+ this.treeChStateChange(e.children);
16195
+ }
16196
+ });
16197
+ }
16198
+ //#endregion
16199
+ /**
16200
+ * 执行选择项发生改变后事件
16201
+ */
16202
+ doSelectedAfterFun() {
16203
+ if (this.props.selType == 1) {
16204
+ this.ctx.emit("on-change", this.UnitValue.value);
16205
+ } else {
16206
+ this.ctx.emit("on-change", this.StructureInstanceCheckData.value.map((e) => e["Id"]));
16207
+ }
16208
+ }
16209
+ }
16210
+ const StructureSelect_vue_vue_type_style_index_0_scoped_502883e6_lang = "";
16211
+ const _withScopeId = (n) => (pushScopeId("data-v-502883e6"), n = n(), popScopeId(), n);
16212
+ const _hoisted_1 = { key: 1 };
16213
+ const _hoisted_2 = { class: "nv-pos-r" };
16214
+ const _hoisted_3 = { class: "nv-c-p structure-sel-box" };
16215
+ const _hoisted_4 = { key: 0 };
16216
+ const _hoisted_5 = {
16217
+ key: 0,
16218
+ class: "nv-text-nowrap"
16219
+ };
16220
+ const _hoisted_6 = { key: 1 };
16221
+ const _hoisted_7 = { key: 0 };
16222
+ const _hoisted_8 = { key: 1 };
16223
+ const _hoisted_9 = {
16224
+ key: 0,
16225
+ style: { "margin-bottom": "10px" }
16226
+ };
16227
+ const _hoisted_10 = {
16228
+ class: "nv-flex",
16229
+ style: { "height": "280px" }
16230
+ };
16231
+ const _hoisted_11 = { class: "nv-flex-1 nv-flex-col nv-full-h" };
16232
+ const _hoisted_12 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "单位工程:", -1));
16233
+ const _hoisted_13 = { class: "nv-flex-1 nv-overflow-auto" };
16234
+ const _hoisted_14 = {
16235
+ key: 0,
16236
+ class: "nv-flex-1 nv-full-h nv-overflow-auto nv-pos-r"
16237
+ };
16238
+ const _hoisted_15 = { key: 0 };
16239
+ const _hoisted_16 = {
16240
+ class: "nv-flex-1 nv-text-nowrap",
16241
+ style: { "margin-left": "7px" }
16242
+ };
16243
+ const _hoisted_17 = { key: 0 };
16244
+ const _hoisted_18 = { key: 1 };
16245
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
16246
+ const _component_Option = resolveComponent("Option");
16247
+ const _component_OptionGroup = resolveComponent("OptionGroup");
16248
+ const _component_Select = resolveComponent("Select");
16249
+ const _component_Radio = resolveComponent("Radio");
16250
+ const _component_RadioGroup = resolveComponent("RadioGroup");
16251
+ const _component_nvLoading = resolveComponent("nvLoading");
16252
+ const _component_Tree = resolveComponent("Tree");
16253
+ const _component_Poptip = resolveComponent("Poptip");
16254
+ const _component_Icon = resolveComponent("Icon");
16255
+ return _ctx.selType == 1 ? (openBlock(), createBlock(_component_Select, {
16256
+ key: 0,
16257
+ modelValue: _ctx.UnitValue,
16258
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.UnitValue = $event),
16259
+ multiple: _ctx.multiple,
16260
+ transfer: "",
16261
+ filterable: "",
16262
+ clearable: "",
16263
+ onOnChange: _ctx.unitSelectChange,
16264
+ disabled: _ctx.readonly
16265
+ }, {
16266
+ default: withCtx(() => [
16267
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.TypeGroupData, (item, index) => {
16268
+ return openBlock(), createBlock(_component_OptionGroup, {
16269
+ label: item.NodeTypeName
16270
+ }, {
16271
+ default: withCtx(() => [
16272
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.UnitData, (item2) => {
16273
+ return openBlock(), createBlock(_component_Option, {
16274
+ value: item2.Id,
16275
+ key: item2.Id
16276
+ }, {
16277
+ default: withCtx(() => [
16278
+ createTextVNode(toDisplayString(item2.NodeName), 1)
16279
+ ]),
16280
+ _: 2
16281
+ }, 1032, ["value"]);
16282
+ }), 128))
16283
+ ]),
16284
+ _: 2
16285
+ }, 1032, ["label"]);
16286
+ }), 256))
16287
+ ]),
16288
+ _: 1
16289
+ }, 8, ["modelValue", "multiple", "onOnChange", "disabled"])) : (openBlock(), createElementBlock("div", _hoisted_1, [
16290
+ createVNode(_component_Poptip, {
16291
+ placement: "bottom-start",
16292
+ width: 700,
16293
+ transfer: ""
16294
+ }, {
16295
+ content: withCtx(() => [
16296
+ _ctx.TypeGroupData.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_9, [
16297
+ createVNode(_component_RadioGroup, {
16298
+ modelValue: _ctx.activeNodeType,
16299
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.activeNodeType = $event),
16300
+ type: "button",
16301
+ size: "small",
16302
+ "button-style": "solid",
16303
+ onOnChange: _ctx.NodeTypeSelect
16304
+ }, {
16305
+ default: withCtx(() => [
16306
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.TypeGroupData, (item, index) => {
16307
+ return openBlock(), createBlock(_component_Radio, {
16308
+ key: index,
16309
+ label: item.NodeTypeName
16310
+ }, null, 8, ["label"]);
16311
+ }), 128))
16312
+ ]),
16313
+ _: 1
16314
+ }, 8, ["modelValue", "onOnChange"])
16315
+ ])) : createCommentVNode("", true),
16316
+ createElementVNode("div", _hoisted_10, [
16317
+ createElementVNode("div", _hoisted_11, [
16318
+ _hoisted_12,
16319
+ createElementVNode("div", _hoisted_13, [
16320
+ createVNode(_component_RadioGroup, {
16321
+ modelValue: _ctx.activeUnit,
16322
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.activeUnit = $event),
16323
+ vertical: "",
16324
+ onOnChange: _ctx.unitSelected
16325
+ }, {
16326
+ default: withCtx(() => [
16327
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.unitData, (item, index) => {
16328
+ return openBlock(), createBlock(_component_Radio, {
16329
+ label: item.Id
16330
+ }, {
16331
+ default: withCtx(() => [
16332
+ createElementVNode("span", null, toDisplayString(item.NodeName), 1)
16333
+ ]),
16334
+ _: 2
16335
+ }, 1032, ["label"]);
16336
+ }), 256))
16337
+ ]),
16338
+ _: 1
16339
+ }, 8, ["modelValue", "onOnChange"])
16340
+ ])
16341
+ ]),
16342
+ _ctx.selType == 2 ? (openBlock(), createElementBlock("div", _hoisted_14, [
16343
+ _ctx.StructureInstanceLoading ? (openBlock(), createBlock(_component_nvLoading, { key: 0 })) : (openBlock(), createBlock(_component_Tree, {
16344
+ key: 1,
16345
+ style: { "width": "calc(100% - 30px)" },
16346
+ data: _ctx.StructureInstanceData,
16347
+ "load-data": _ctx.loadStructureInstance,
16348
+ "check-strictly": true,
16349
+ "show-checkbox": _ctx.multiple,
16350
+ onOnCheckChange: _ctx.StructureInstanceCheckFun,
16351
+ onOnSelectChange: _ctx.StructureInstanceSelectFun
16352
+ }, null, 8, ["data", "load-data", "show-checkbox", "onOnCheckChange", "onOnSelectChange"]))
16353
+ ])) : createCommentVNode("", true)
16354
+ ])
16355
+ ]),
16356
+ default: withCtx(() => [
16357
+ createElementVNode("div", _hoisted_2, [
16358
+ createElementVNode("div", _hoisted_3, [
16359
+ _ctx.StructureInstanceCheckData.length == 0 ? (openBlock(), createElementBlock("div", _hoisted_4, "点击选择构件")) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
16360
+ _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_5, " 已选择" + toDisplayString(_ctx.StructureInstanceCheckData.length) + "个构件(" + toDisplayString(_ctx.StructureInstanceCheckData.map((e) => e["NodeName"]).toString()) + ") ", 1)) : (openBlock(), createElementBlock("div", _hoisted_6, [
16361
+ createTextVNode(toDisplayString(_ctx.StructureInstanceCheckData[0].NodeName) + " ", 1),
16362
+ _ctx.StructureInstanceCheckData[0].NodeTypeName ? (openBlock(), createElementBlock("span", _hoisted_7, "[" + toDisplayString(_ctx.StructureInstanceCheckData[0].NodeTypeName) + "]", 1)) : createCommentVNode("", true),
16363
+ _ctx.StructureInstanceCheckData[0].UnitName ? (openBlock(), createElementBlock("span", _hoisted_8, "[" + toDisplayString(_ctx.StructureInstanceCheckData[0].UnitName) + "]", 1)) : createCommentVNode("", true)
16364
+ ]))
16365
+ ], 64))
16366
+ ])
16367
+ ])
16368
+ ]),
16369
+ _: 1
16370
+ }),
16371
+ _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_15, [
16372
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.StructureInstanceCheckData, (item, index) => {
16373
+ return openBlock(), createElementBlock("div", {
16374
+ class: "nv-flex",
16375
+ key: index
16376
+ }, [
16377
+ !_ctx.readonly ? (openBlock(), createBlock(_component_Icon, {
16378
+ key: 0,
16379
+ class: "nv-c-p",
16380
+ type: "md-trash",
16381
+ onClick: withModifiers(($event) => _ctx.removeStructureInstance(item), ["stop"]),
16382
+ size: 20,
16383
+ color: "#ae5d55"
16384
+ }, null, 8, ["onClick"])) : createCommentVNode("", true),
16385
+ createElementVNode("div", _hoisted_16, [
16386
+ createTextVNode(toDisplayString(item.NodeName) + " ", 1),
16387
+ item.NodeTypeName ? (openBlock(), createElementBlock("span", _hoisted_17, "[" + toDisplayString(item.NodeTypeName) + "]", 1)) : createCommentVNode("", true),
16388
+ item.UnitName ? (openBlock(), createElementBlock("span", _hoisted_18, "[" + toDisplayString(item.UnitName) + "]", 1)) : createCommentVNode("", true)
16389
+ ])
16390
+ ]);
16391
+ }), 128))
16392
+ ])) : createCommentVNode("", true)
16393
+ ]));
16394
+ }
16395
+ const NvStructureSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-502883e6"]]);
15469
16396
  export {
15470
16397
  filePreview as FilePreview,
15471
16398
  ComFormUp as NvComFormUp,
16399
+ NvDicSelect,
16400
+ NvStructureSelect,
16401
+ NvStructureTypeSelect,
15472
16402
  TextEditor2 as TextEditor,
15473
16403
  UploadFile
15474
16404
  };