@newview/file-ui 1.1.6 → 1.1.8
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/README.md +2 -2
- package/dist/file-ui.js +118 -63
- package/dist/file-ui.umd.cjs +1 -1
- package/package.json +3 -2
- package/types/ComFormUp.d.ts +19 -1
- package/types/TextEditor.d.ts +11 -0
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
版本 1.1.
|
|
1
|
+
版本 1.1.8
|
|
2
2
|
|
|
3
|
-
1.
|
|
3
|
+
1. ComFormUp 添加 TextEditor 组件导出的方法
|
package/dist/file-ui.js
CHANGED
|
@@ -5,7 +5,7 @@ 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, createTextVNode, toDisplayString, onMounted, onBeforeUnmount, nextTick, h, watchEffect } from "vue";
|
|
8
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createElementVNode, reactive, renderList, createBlock, createSlots, normalizeClass, withModifiers, createCommentVNode, createTextVNode, toDisplayString, onMounted, onBeforeUnmount, nextTick, h, watchEffect, normalizeStyle } from "vue";
|
|
9
9
|
import { QueryWrapper } from "@newview/infrastructure";
|
|
10
10
|
import { OSSFileApi, FileApi, UploadApi, FileInfoApi } from "@newview/fileservice-api";
|
|
11
11
|
const propDefine$3 = {
|
|
@@ -772,63 +772,6 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
772
772
|
]);
|
|
773
773
|
}
|
|
774
774
|
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-decdfed6"]]);
|
|
775
|
-
const propDefine$1 = {
|
|
776
|
-
onlyView: {
|
|
777
|
-
// 是否只读
|
|
778
|
-
type: Boolean,
|
|
779
|
-
default: false
|
|
780
|
-
},
|
|
781
|
-
formItems: {
|
|
782
|
-
// 表单项
|
|
783
|
-
type: Array,
|
|
784
|
-
default: () => []
|
|
785
|
-
},
|
|
786
|
-
formModel: {
|
|
787
|
-
// 表单数据
|
|
788
|
-
type: Object,
|
|
789
|
-
default: () => {
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
const _sfc_main$1 = defineComponent({
|
|
794
|
-
name: "NvComFormUp",
|
|
795
|
-
components: { UploadFile },
|
|
796
|
-
emits: [""],
|
|
797
|
-
props: propDefine$1,
|
|
798
|
-
setup(props, ctx) {
|
|
799
|
-
return new ComFormInstance(props, ctx);
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
class ComFormInstance extends BaseInstance {
|
|
803
|
-
// API实例化
|
|
804
|
-
// 全局属性
|
|
805
|
-
constructor(props, ctx) {
|
|
806
|
-
super();
|
|
807
|
-
__publicField(this, "props");
|
|
808
|
-
__publicField(this, "ctx");
|
|
809
|
-
this.props = props;
|
|
810
|
-
this.ctx = ctx;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
814
|
-
const _component_UploadFile = resolveComponent("UploadFile");
|
|
815
|
-
const _component_NvComForm = resolveComponent("NvComForm");
|
|
816
|
-
return openBlock(), createBlock(_component_NvComForm, {
|
|
817
|
-
onlyView: _ctx.onlyView,
|
|
818
|
-
formItems: _ctx.formItems,
|
|
819
|
-
formModel: _ctx.formModel
|
|
820
|
-
}, {
|
|
821
|
-
extend: withCtx(({ item }) => [
|
|
822
|
-
item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
|
|
823
|
-
key: 0,
|
|
824
|
-
readonly: _ctx.onlyView,
|
|
825
|
-
token: _ctx.formModel[item.model]
|
|
826
|
-
}, null, 8, ["readonly", "token"])) : createCommentVNode("", true)
|
|
827
|
-
]),
|
|
828
|
-
_: 1
|
|
829
|
-
}, 8, ["onlyView", "formItems", "formModel"]);
|
|
830
|
-
}
|
|
831
|
-
const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
832
775
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
833
776
|
function getDefaultExportFromCjs(x) {
|
|
834
777
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -15160,7 +15103,7 @@ const QuillEditor = defineComponent({
|
|
|
15160
15103
|
});
|
|
15161
15104
|
const vueQuill_snow = "";
|
|
15162
15105
|
const vueQuill_bubble = "";
|
|
15163
|
-
const propDefine = {
|
|
15106
|
+
const propDefine$1 = {
|
|
15164
15107
|
modelValue: {
|
|
15165
15108
|
default: "",
|
|
15166
15109
|
type: String
|
|
@@ -15174,14 +15117,14 @@ const propDefine = {
|
|
|
15174
15117
|
default: false
|
|
15175
15118
|
}
|
|
15176
15119
|
};
|
|
15177
|
-
const _sfc_main = defineComponent({
|
|
15120
|
+
const _sfc_main$1 = defineComponent({
|
|
15178
15121
|
name: "TextEditor",
|
|
15179
15122
|
components: {
|
|
15180
15123
|
QuillEditor
|
|
15181
15124
|
},
|
|
15182
15125
|
emits: ["update:modelValue", "textChange"],
|
|
15183
15126
|
// 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
|
|
15184
|
-
props: propDefine,
|
|
15127
|
+
props: propDefine$1,
|
|
15185
15128
|
setup(props, ctx) {
|
|
15186
15129
|
return new TextEditor$1(props, ctx);
|
|
15187
15130
|
}
|
|
@@ -15223,6 +15166,9 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15223
15166
|
}));
|
|
15224
15167
|
// 私有方法 | private 方法名() {}
|
|
15225
15168
|
// 响应式方法 | xxx = () => {}
|
|
15169
|
+
/**
|
|
15170
|
+
* 监听长文本变化
|
|
15171
|
+
*/
|
|
15226
15172
|
__publicField(this, "textChange", () => {
|
|
15227
15173
|
this.ctx.emit("update:modelValue", this.content.value);
|
|
15228
15174
|
this.ctx.emit("textChange", this.content.value);
|
|
@@ -15239,6 +15185,20 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15239
15185
|
__publicField(this, "deleteTextData", async () => {
|
|
15240
15186
|
await this.fileApi.deleteByToken(this.props.token);
|
|
15241
15187
|
});
|
|
15188
|
+
/**
|
|
15189
|
+
* 删除长文本
|
|
15190
|
+
* @param Token
|
|
15191
|
+
*/
|
|
15192
|
+
__publicField(this, "deleteTextDataByToken", async (Token) => {
|
|
15193
|
+
await this.fileApi.deleteByToken(Token);
|
|
15194
|
+
});
|
|
15195
|
+
/**
|
|
15196
|
+
* 清空长文本
|
|
15197
|
+
*/
|
|
15198
|
+
__publicField(this, "clearTextData", async () => {
|
|
15199
|
+
this.content.value = "";
|
|
15200
|
+
this.QuillEditorRef.value.setHTML("");
|
|
15201
|
+
});
|
|
15242
15202
|
this.props = props;
|
|
15243
15203
|
this.ctx = ctx;
|
|
15244
15204
|
this.init();
|
|
@@ -15277,7 +15237,7 @@ let TextEditor$1 = class TextEditor extends BaseInstance {
|
|
|
15277
15237
|
};
|
|
15278
15238
|
const TextEditor_vue_vue_type_style_index_0_scoped_5e7ac7cc_lang = "";
|
|
15279
15239
|
const _hoisted_1 = { style: { "height": "100%" } };
|
|
15280
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15240
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15281
15241
|
const _component_QuillEditor = resolveComponent("QuillEditor");
|
|
15282
15242
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
15283
15243
|
_ctx.componentShow ? (openBlock(), createBlock(_component_QuillEditor, {
|
|
@@ -15293,7 +15253,102 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
15293
15253
|
}, null, 8, ["content", "readOnly", "theme", "onTextChange", "options"])) : createCommentVNode("", true)
|
|
15294
15254
|
]);
|
|
15295
15255
|
}
|
|
15296
|
-
const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5e7ac7cc"]]);
|
|
15256
|
+
const TextEditor2 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-5e7ac7cc"]]);
|
|
15257
|
+
const propDefine = {
|
|
15258
|
+
onlyView: {
|
|
15259
|
+
// 是否只读
|
|
15260
|
+
type: Boolean,
|
|
15261
|
+
default: false
|
|
15262
|
+
},
|
|
15263
|
+
formItems: {
|
|
15264
|
+
// 表单项
|
|
15265
|
+
type: Array,
|
|
15266
|
+
default: () => []
|
|
15267
|
+
},
|
|
15268
|
+
formModel: {
|
|
15269
|
+
// 表单数据
|
|
15270
|
+
type: Object,
|
|
15271
|
+
default: () => {
|
|
15272
|
+
}
|
|
15273
|
+
}
|
|
15274
|
+
};
|
|
15275
|
+
const _sfc_main = defineComponent({
|
|
15276
|
+
name: "NvComFormUp",
|
|
15277
|
+
components: { UploadFile, TextEditor: TextEditor2 },
|
|
15278
|
+
emits: [""],
|
|
15279
|
+
props: propDefine,
|
|
15280
|
+
setup(props, ctx) {
|
|
15281
|
+
return new ComFormInstance(props, ctx);
|
|
15282
|
+
}
|
|
15283
|
+
});
|
|
15284
|
+
class ComFormInstance extends BaseInstance {
|
|
15285
|
+
// API实例化
|
|
15286
|
+
// 全局属性
|
|
15287
|
+
constructor(props, ctx) {
|
|
15288
|
+
super();
|
|
15289
|
+
__publicField(this, "props");
|
|
15290
|
+
__publicField(this, "ctx");
|
|
15291
|
+
//#region 文本输入框
|
|
15292
|
+
// 私有属性 | private
|
|
15293
|
+
// 响应属性 | ref、reactive、computed、watch
|
|
15294
|
+
__publicField(this, "textEditorRef", ref());
|
|
15295
|
+
// 私有方法 | private 方法名() {}
|
|
15296
|
+
// 响应式方法 | xxx = () => {}
|
|
15297
|
+
/**
|
|
15298
|
+
* @description 保存文本数据
|
|
15299
|
+
*/
|
|
15300
|
+
__publicField(this, "saveTextData", async () => {
|
|
15301
|
+
this.textEditorRef.value.saveTextData();
|
|
15302
|
+
});
|
|
15303
|
+
/**
|
|
15304
|
+
* 清空长文本
|
|
15305
|
+
*/
|
|
15306
|
+
__publicField(this, "clearTextData", async () => {
|
|
15307
|
+
this.textEditorRef.value.clearTextData();
|
|
15308
|
+
});
|
|
15309
|
+
/**删除长文本 */
|
|
15310
|
+
__publicField(this, "deleteTextData", async () => {
|
|
15311
|
+
this.textEditorRef.value.deleteTextData();
|
|
15312
|
+
});
|
|
15313
|
+
/**
|
|
15314
|
+
* 删除长文本
|
|
15315
|
+
* @param Token
|
|
15316
|
+
*/
|
|
15317
|
+
__publicField(this, "deleteTextDataByToken", async (Token) => {
|
|
15318
|
+
this.textEditorRef.value.deleteTextDataByToken(Token);
|
|
15319
|
+
});
|
|
15320
|
+
this.props = props;
|
|
15321
|
+
this.ctx = ctx;
|
|
15322
|
+
}
|
|
15323
|
+
//#endregion 文本输入框 END
|
|
15324
|
+
}
|
|
15325
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15326
|
+
const _component_UploadFile = resolveComponent("UploadFile");
|
|
15327
|
+
const _component_TextEditor = resolveComponent("TextEditor");
|
|
15328
|
+
const _component_NvComForm = resolveComponent("NvComForm");
|
|
15329
|
+
return openBlock(), createBlock(_component_NvComForm, {
|
|
15330
|
+
onlyView: _ctx.onlyView,
|
|
15331
|
+
formItems: _ctx.formItems,
|
|
15332
|
+
formModel: _ctx.formModel
|
|
15333
|
+
}, {
|
|
15334
|
+
extend: withCtx(({ item }) => [
|
|
15335
|
+
item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
|
|
15336
|
+
key: 0,
|
|
15337
|
+
readonly: _ctx.onlyView,
|
|
15338
|
+
token: _ctx.formModel[item.model]
|
|
15339
|
+
}, null, 8, ["readonly", "token"])) : createCommentVNode("", true),
|
|
15340
|
+
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
15341
|
+
key: 1,
|
|
15342
|
+
ref: "textEditorRef",
|
|
15343
|
+
readonly: _ctx.onlyView,
|
|
15344
|
+
style: normalizeStyle({ height: `${item.textHeight == void 0 ? "300" : item.textHeight}px` }),
|
|
15345
|
+
token: _ctx.formModel[item.model]
|
|
15346
|
+
}, null, 8, ["readonly", "style", "token"])) : createCommentVNode("", true)
|
|
15347
|
+
]),
|
|
15348
|
+
_: 1
|
|
15349
|
+
}, 8, ["onlyView", "formItems", "formModel"]);
|
|
15350
|
+
}
|
|
15351
|
+
const ComFormUp = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
15297
15352
|
export {
|
|
15298
15353
|
filePreview as FilePreview,
|
|
15299
15354
|
ComFormUp as NvComFormUp,
|