cloud-web-corejs 1.1.0-dev.4 → 1.1.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/VabUpload/index.vue +1 -1
- package/src/components/excelImport/index.vue +1 -1
- package/src/components/jsonImport/index.vue +1 -1
- package/src/components/langImport/index.vue +1 -1
- package/src/components/obsUpload/index.vue +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +1 -1
- package/src/components/xform/form-designer/indexMixin.js +8 -1
- package/src/components/xform/form-designer/toolbar-panel/index.vue +1 -1
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -0
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +15 -4
- package/src/layout/components/Sidebar/default.vue +1 -1
- package/src/utils/assetUrl.js +19 -0
- package/src/utils/vab.js +5 -1
- package/src/views/user/home/default.vue +1 -1
- package/src/views/user/home/default2.vue +1 -1
- package/src/views/user/home/wjl/content.vue +1 -1
- package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
<ul class="el-upload-list el-upload-list--picture">
|
|
30
30
|
<div class="nodata" v-if="pasteList.length == 0">
|
|
31
|
-
<img src="
|
|
31
|
+
<img :src="$assetUrl(require('@/resources/images/nodata2.png'))" />
|
|
32
32
|
</div>
|
|
33
33
|
<li v-for="(pasteFile,index) in pasteList" :key="index" class="el-upload-list__item is-success">
|
|
34
34
|
<div>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</el-upload>
|
|
28
28
|
<div class="upload-finish" v-if="fileRaw">
|
|
29
|
-
<img :src="require('@/resources' + '/images/ico-excel.svg')" class="ico"/>
|
|
29
|
+
<img :src="$assetUrl(require('@/resources' + '/images/ico-excel.svg'))" class="ico"/>
|
|
30
30
|
<p class="name">{{ fileRaw.name }}</p>
|
|
31
31
|
<!-- <p>2022-1-17</p> -->
|
|
32
32
|
<el-tooltip :enterable="false" class="item" effect="dark"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
</el-upload>
|
|
23
23
|
<div class="upload-finish" v-if="fileRaw">
|
|
24
|
-
<img :src="require('@/resources' + '/images/ico-txt.svg')" class="ico"/>
|
|
24
|
+
<img :src="$assetUrl(require('@/resources' + '/images/ico-txt.svg'))" class="ico"/>
|
|
25
25
|
<p class="name">{{ fileRaw.name }}</p>
|
|
26
26
|
<!-- <p>2022-1-17</p> -->
|
|
27
27
|
<el-tooltip :enterable="false" class="item" effect="dark"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
</el-upload>
|
|
23
23
|
<div class="upload-finish" v-if="fileRaw">
|
|
24
|
-
<img :src="require('@/resources' + '/images/ico-txt.svg')" class="ico"/>
|
|
24
|
+
<img :src="$assetUrl(require('@/resources' + '/images/ico-txt.svg'))" class="ico"/>
|
|
25
25
|
<p class="name">{{ fileRaw.name }}</p>
|
|
26
26
|
<!-- <p>2022-1-17</p> -->
|
|
27
27
|
<el-tooltip :enterable="false" class="item" effect="dark"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
<ul class="el-upload-list el-upload-list--picture">
|
|
22
22
|
<div class="nodata" v-if="pasteList.length == 0">
|
|
23
|
-
<img src="
|
|
23
|
+
<img :src="$assetUrl(require('@/resources/images/nodata2.png'))" />
|
|
24
24
|
</div>
|
|
25
25
|
<li v-for="(pasteFile,index) in pasteList" :key="index" class="el-upload-list__item is-success">
|
|
26
26
|
<div>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</el-upload>
|
|
27
27
|
<div class="upload-finish" v-if="fileRaw">
|
|
28
|
-
<img :src="require('@/resources' + '/images/ico-excel.svg')" class="ico"/>
|
|
28
|
+
<img :src="$assetUrl(require('@/resources' + '/images/ico-excel.svg'))" class="ico"/>
|
|
29
29
|
<p class="name">{{ fileRaw.name }}</p>
|
|
30
30
|
<!-- <p>2022-1-17</p> -->
|
|
31
31
|
<el-tooltip :enterable="false" class="item" effect="dark"
|
|
@@ -360,6 +360,11 @@ modules = {
|
|
|
360
360
|
if (modifiedFlag) {
|
|
361
361
|
this.designer.emitHistoryChange();
|
|
362
362
|
}
|
|
363
|
+
/* 模板 JSON 里的 layoutType 此刻才写入;左侧面板 mounted 时仍是默认 PC,
|
|
364
|
+
必须再筛一次,否则进入 H5 模板时仍展示 PC 容器(data-table/detail 等) */
|
|
365
|
+
this.$nextTick(() => {
|
|
366
|
+
this.loadWidgets();
|
|
367
|
+
});
|
|
363
368
|
} else {
|
|
364
369
|
this.clearDesigner();
|
|
365
370
|
}
|
|
@@ -826,7 +831,9 @@ modules = {
|
|
|
826
831
|
});
|
|
827
832
|
},
|
|
828
833
|
loadWidgets() {
|
|
829
|
-
this.$refs.widgetPanelRef
|
|
834
|
+
if (this.$refs.widgetPanelRef) {
|
|
835
|
+
this.$refs.widgetPanelRef.loadWidgets();
|
|
836
|
+
}
|
|
830
837
|
},
|
|
831
838
|
getBdEnv() {
|
|
832
839
|
getBdFlag({
|
|
@@ -354,6 +354,7 @@ modules = {
|
|
|
354
354
|
let importObj = JSON.parse(this.importTemplate);
|
|
355
355
|
this.designer.handleImportJson(importObj);
|
|
356
356
|
this.designer.loadFormJson(importObj);
|
|
357
|
+
this.$emit("loadWidgets");
|
|
357
358
|
|
|
358
359
|
this.showImportJsonDialogFlag = false;
|
|
359
360
|
this.$message.success(this.i18nt("designer.hint.importJsonSuccess"));
|
|
@@ -115,6 +115,16 @@ modules = {
|
|
|
115
115
|
? !1
|
|
116
116
|
: !!this.designerConfig.metadataLib;
|
|
117
117
|
},
|
|
118
|
+
currentLayoutType() {
|
|
119
|
+
return (this.designer && this.designer.formConfig && this.designer.formConfig.layoutType) || "PC";
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
watch: {
|
|
123
|
+
/* 打开 H5 模板是 setFormJson 后才写入 layoutType;面板 mounted 时仍是默认 PC。
|
|
124
|
+
版式变化后必须按新 layoutType 重筛,否则左侧一直停在 PC 组件列表。 */
|
|
125
|
+
currentLayoutType() {
|
|
126
|
+
this.loadWidgets();
|
|
127
|
+
},
|
|
118
128
|
},
|
|
119
129
|
mounted() {
|
|
120
130
|
this.designerConfig.chartLib && (this.firstTab = "chartLib"),
|
|
@@ -181,7 +191,8 @@ modules = {
|
|
|
181
191
|
|
|
182
192
|
this.commonContainers = this.containers.filter(con => !!con.commonFlag && this.getIsShow(con));
|
|
183
193
|
|
|
184
|
-
|
|
194
|
+
/* 每次从 widgetsConfig 原表筛,不能拿 this.xxx(已被上次 layoutType 滤过)再滤一遍 */
|
|
195
|
+
this.basicFields = basicFields.map(fld => {
|
|
185
196
|
return {
|
|
186
197
|
...fld,
|
|
187
198
|
displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
|
|
@@ -190,7 +201,7 @@ modules = {
|
|
|
190
201
|
return !this.isBanned(fld.type) && this.getIsShow(fld);
|
|
191
202
|
});
|
|
192
203
|
|
|
193
|
-
this.advancedFields =
|
|
204
|
+
this.advancedFields = advancedFields.map(fld => {
|
|
194
205
|
return {
|
|
195
206
|
...fld,
|
|
196
207
|
displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
|
|
@@ -209,7 +220,7 @@ modules = {
|
|
|
209
220
|
);
|
|
210
221
|
this.advancedFields = this.sortByPanelOrder(this.advancedFields, widgetPanelOrder.advancedFields);
|
|
211
222
|
|
|
212
|
-
this.businessFields =
|
|
223
|
+
this.businessFields = businessFields.map(fld => {
|
|
213
224
|
return {
|
|
214
225
|
...fld,
|
|
215
226
|
displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
|
|
@@ -229,7 +240,7 @@ modules = {
|
|
|
229
240
|
&& moveTypes.indexOf(fld.type) === -1;
|
|
230
241
|
}), widgetPanelOrder.advancedFields);
|
|
231
242
|
|
|
232
|
-
this.customFields =
|
|
243
|
+
this.customFields = customFields.map(fld => {
|
|
233
244
|
return {
|
|
234
245
|
...fld,
|
|
235
246
|
displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
|
|
@@ -757,7 +757,7 @@ export default {
|
|
|
757
757
|
let userInfo = res.objx;
|
|
758
758
|
this.headPhotoUrl = userInfo.headPhotoUrl
|
|
759
759
|
? userInfo.headPhotoUrl
|
|
760
|
-
: require("@/resources/images"
|
|
760
|
+
: (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
|
|
761
761
|
this.userInfo = userInfo;
|
|
762
762
|
},
|
|
763
763
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 取出 require(图片) 的真实 URL。
|
|
3
|
+
*
|
|
4
|
+
* webpack4(url-loader,vue-cli 设了 esModule:false) 下 require 直接返回 URL 字符串;
|
|
5
|
+
* webpack5(vue-cli5 的 asset modules) 下返回的是 ES Module 命名空间对象,且该对象
|
|
6
|
+
* 由 Object.create(null) 生成——没有原型链就没有 toString,直接绑到 :src 上时
|
|
7
|
+
* setAttribute 会抛 "Cannot convert object to primitive value" 整棵子树渲染失败
|
|
8
|
+
* (webpack5 的 asset modules 没有 esModule 开关,只能在取值处兜底)。
|
|
9
|
+
*
|
|
10
|
+
* 消费应用的构建配置不受本库控制,凡是把 require 结果往 DOM 属性上放的地方都要过这里。
|
|
11
|
+
*/
|
|
12
|
+
export function assetUrl(mod) {
|
|
13
|
+
if (mod && typeof mod === "object") {
|
|
14
|
+
return mod.default || "";
|
|
15
|
+
}
|
|
16
|
+
return mod || "";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default assetUrl;
|
package/src/utils/vab.js
CHANGED
|
@@ -13,6 +13,7 @@ import XEUtils from "xe-utils";
|
|
|
13
13
|
import prefixConfig from "@/prefixConfig.js";
|
|
14
14
|
import moment from "moment";
|
|
15
15
|
import { openView } from "./repeatOpen";
|
|
16
|
+
import { assetUrl } from "./assetUrl";
|
|
16
17
|
|
|
17
18
|
let imFun = {
|
|
18
19
|
request,
|
|
@@ -28,7 +29,8 @@ let imFun = {
|
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
function reqImg(a) {
|
|
31
|
-
|
|
32
|
+
/* webpack5 下 require 返回的是无原型的 Module 对象,直接当 src 用会崩,统一取真实 URL */
|
|
33
|
+
return assetUrl(require("@/resources/images/" + a));
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
const FILE_ICON_NAME_MAP = {
|
|
@@ -398,6 +400,8 @@ install = (Vue, opts = {}) => {
|
|
|
398
400
|
Vue.prototype.$baseLodash = imFun.lodash;
|
|
399
401
|
/* 全局事件总线 */
|
|
400
402
|
Vue.prototype.$baseEventBus = new Vue();
|
|
403
|
+
/* 模板里 :src="$assetUrl(require(...))" 用,见 utils/assetUrl.js */
|
|
404
|
+
Vue.prototype.$assetUrl = assetUrl;
|
|
401
405
|
|
|
402
406
|
Vue.prototype.$commonFileUtil = {
|
|
403
407
|
// 文件类型获取与判断接口
|
|
@@ -355,7 +355,7 @@ export default {
|
|
|
355
355
|
let userInfo = res.objx;
|
|
356
356
|
this.headPhotoUrl = userInfo.headPhotoUrl
|
|
357
357
|
? userInfo.headPhotoUrl
|
|
358
|
-
: require("@/resources/images"
|
|
358
|
+
: (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
|
|
359
359
|
|
|
360
360
|
this.userInfo = userInfo;
|
|
361
361
|
},
|
|
@@ -594,7 +594,7 @@ export default {
|
|
|
594
594
|
let userInfo = res.objx;
|
|
595
595
|
this.headPhotoUrl = userInfo.headPhotoUrl
|
|
596
596
|
? userInfo.headPhotoUrl
|
|
597
|
-
: require("@/resources/images"
|
|
597
|
+
: (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
|
|
598
598
|
|
|
599
599
|
this.userInfo = userInfo;
|
|
600
600
|
},
|
|
@@ -483,7 +483,7 @@ export default {
|
|
|
483
483
|
let userInfo = res.objx;
|
|
484
484
|
this.headPhotoUrl = userInfo.headPhotoUrl
|
|
485
485
|
? userInfo.headPhotoUrl
|
|
486
|
-
: require("@/resources/images"
|
|
486
|
+
: (require("@/resources/images/default-header.png").default || require("@/resources/images/default-header.png"));
|
|
487
487
|
|
|
488
488
|
this.userInfo = userInfo;
|
|
489
489
|
this.initServiceProviderRole();
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</el-upload>
|
|
22
22
|
<div class="upload-finish" v-if="fileRaw">
|
|
23
|
-
<img :src="require('@/resources' + '/images/ico-txt.svg')" class="ico"/>
|
|
23
|
+
<img :src="$assetUrl(require('@/resources' + '/images/ico-txt.svg'))" class="ico"/>
|
|
24
24
|
<p class="name">{{ fileRaw.name }}</p>
|
|
25
25
|
<!-- <p>2022-1-17</p> -->
|
|
26
26
|
<el-tooltip :enterable="false" class="item" effect="dark"
|