cloud-web-corejs 1.1.0-dev.82 → 1.1.0-dev.83

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.1.0-dev.82",
4
+ "version": "1.1.0-dev.83",
5
5
  "scripts": {
6
6
  "build:ace-resources": "node build/build-ace-resources.js",
7
7
  "build:tinymce-resources": "node build/build-tinymce-resources.js",
@@ -1471,6 +1471,11 @@ tViewMixins = {
1471
1471
  type: Boolean,
1472
1472
  default: false,
1473
1473
  },
1474
+ /* 附件卡片上的下载按钮,默认显示。传 false 或 "false" 时隐藏 */
1475
+ showDownload: {
1476
+ type: [Boolean, String],
1477
+ default: true,
1478
+ },
1474
1479
  },
1475
1480
  data() {
1476
1481
  return {
@@ -95,6 +95,7 @@
95
95
  </div>
96
96
  <div class="el-icon-tagEdit" v-if="attachment.h5 !== 1">
97
97
  <el-tooltip
98
+ v-if="showDownloadButton"
98
99
  class="item"
99
100
  effect="dark"
100
101
  :content="$t2('下载', 'system.button.download')"
@@ -226,6 +227,9 @@ export default {
226
227
  ElImageViewer: () => import("./image-viewer"),
227
228
  },
228
229
  computed: {
230
+ showDownloadButton() {
231
+ return this.showDownload !== false && this.showDownload !== "false";
232
+ },
229
233
  classList() {
230
234
  // 'upload-img': this.dataType || (this.$attrs.hideInfo == true || this.$attrs.hideInfo == 'true')
231
235
  let arr = [];
@@ -27,6 +27,7 @@
27
27
  </template>
28
28
  <uploadDialog v-if="showUploadDialog" :visiable.sync="showUploadDialog"
29
29
  :rows.sync="rows" :title="title" :edit="edit" :param.sync="option.uploadConfig"
30
+ :showDownload="showDownloadButton"
30
31
  :onConfirm="confirmInsertAttachment"/>
31
32
  </template>
32
33
  </span>
@@ -47,6 +47,11 @@ indexMixin = {
47
47
  showViewButton() {
48
48
  return this.option && this.option.showViewButton !== false ? true : false;
49
49
  },
50
+ /* 未传或非 false 时显示下载按钮 */
51
+ showDownloadButton() {
52
+ let value = this.option && this.option.showDownloadButton;
53
+ return value !== false && value !== "false";
54
+ },
50
55
  fileServerPreviewEnabled(){
51
56
  return this.getFileServerPreviewEnabled();
52
57
  },
@@ -269,6 +274,11 @@ uploadDialogMixin = {
269
274
  type: Boolean,
270
275
  default: false,
271
276
  },
277
+ /* 附件弹窗里的下载按钮,默认显示 */
278
+ showDownload: {
279
+ type: Boolean,
280
+ default: true,
281
+ },
272
282
  title: {
273
283
  type: String,
274
284
  default: () => this.$t2("凭证信息", "components.baseAttachment.title"),
@@ -283,6 +293,13 @@ uploadDialogMixin = {
283
293
  },
284
294
  mounted() {
285
295
  },
296
+ computed: {
297
+ resolvedShowDownload() {
298
+ if (this.showDownload === false) return false;
299
+ let configValue = this.param && this.param.showDownload;
300
+ return configValue !== false && configValue !== "false";
301
+ },
302
+ },
286
303
  data() {
287
304
  var that = this;
288
305
  return {
@@ -14,7 +14,7 @@
14
14
  {{ attachment.name }}
15
15
  </a>
16
16
  </el-tooltip>
17
- <el-tooltip class="item" effect="dark" :content="$t2('下载', 'system.button.preview')" placement="top"
17
+ <el-tooltip v-if="showDownloadButton" class="item" effect="dark" :content="$t2('下载', 'system.button.preview')" placement="top"
18
18
  :enterable="false">
19
19
  <a
20
20
  href="javascript:void(0);"
@@ -34,7 +34,17 @@
34
34
  export default {
35
35
  name: "attachmentShowList",
36
36
  props: {
37
- rows: Array
37
+ rows: Array,
38
+ /* 未传或非 false 时显示下载按钮 */
39
+ showDownload: {
40
+ type: [Boolean, String],
41
+ default: true
42
+ }
43
+ },
44
+ computed: {
45
+ showDownloadButton() {
46
+ return this.showDownload !== false && this.showDownload !== "false";
47
+ }
38
48
  }
39
49
  }
40
50
  </script>
@@ -15,7 +15,8 @@
15
15
  >
16
16
  <div id="containt">
17
17
  <div class="detail-wrap" style="height: 450px;padding: 10px 10px;">
18
- <baseUpload v-if="showUpload" v-bind="option" :file.sync="checkRows" :edit="edit" multi="true"></baseUpload>
18
+ <baseUpload v-if="showUpload" v-bind="option" :file.sync="checkRows" :edit="edit"
19
+ :showDownload="resolvedShowDownload" multi="true"></baseUpload>
19
20
  </div>
20
21
  </div>
21
22
  <span slot="footer" class="dialog-footer">
@@ -8920,7 +8920,11 @@ var hiprint = function (t) {
8920
8920
  }, t.prototype.getPrintStyle = function () {
8921
8921
  return " <style printStyle>\n @page\n {\n border:0;\n padding:0cm;\n margin:0cm;\n " + this.getPrintSizeStyle() + "\n }\n </style>\n";
8922
8922
  }, t.prototype.getPrintSizeStyle = function () {
8923
- return this.paperType ? "size:" + this.paperType + " " + (this.height > this.width ? "portrait" : "landscape") + ";" : "size: " + this.width + "mm " + this.height + "mm " + (this.orient ? 1 == this.orient ? "portrait" : "landscape" : "") + ";";
8923
+ if (this.paperType) {
8924
+ return "size:" + this.paperType + " " + (this.height > this.width ? "portrait" : "landscape") + ";";
8925
+ }
8926
+ // 自定义纸张由最终宽高决定方向;长度值不能与 portrait/landscape 混用。
8927
+ return "size: " + this.width + "mm " + this.height + "mm;";
8924
8928
  }, t.prototype.deletePrintElement = function (t) {
8925
8929
  var e = this;
8926
8930
  this.printElements.filter(function (n, i) {
@@ -93,6 +93,9 @@ export default {
93
93
  'field.options.disabled'(val) {
94
94
  this.option.edit = !val;
95
95
  },
96
+ 'field.options.showDownloadButton'(val) {
97
+ this.option.showDownloadButton = val !== false;
98
+ },
96
99
  'option':function(){
97
100
 
98
101
  }
@@ -170,10 +173,14 @@ export default {
170
173
  if (!this.field.options.hasOwnProperty('disabled')) {
171
174
  this.$set(this.field.options, 'disabled', false);
172
175
  }
176
+ if (!this.field.options.hasOwnProperty('showDownloadButton')) {
177
+ this.$set(this.field.options, 'showDownloadButton', true);
178
+ }
173
179
  this.option = {
174
180
  title: this.$t1('附件'),
175
181
  edit: !this.field.options.disabled,
176
182
  showViewButton: this.field.options.showViewButton !== false,
183
+ showDownloadButton: this.field.options.showDownloadButton !== false,
177
184
  uploadConfig: {
178
185
  limit: this.field.options.limit,
179
186
  fileTypes: this.field.options.fileTypes || [],
@@ -34,6 +34,7 @@
34
34
  resultType="Array"
35
35
  :edit="!field.options.disabled && !isReadMode"
36
36
  :remove="!field.options.hideRemoveButton && !isReadMode"
37
+ :showDownload="field.options.showDownload !== false"
37
38
  @callback="submitFile"
38
39
  :hideInfo="field.options.hideFileInfo"
39
40
  :hideName="field.options.hideFileName"
@@ -77,7 +77,7 @@
77
77
  tabindex="0"
78
78
  ></i>
79
79
  </div>
80
- <div class="el-icon-tagEdit">
80
+ <div class="el-icon-tagEdit" v-if="field.options.showDownload !== false">
81
81
  <el-tooltip
82
82
  class="item"
83
83
  effect="dark"
@@ -30,22 +30,35 @@
30
30
  <el-form-item :label="i18nt('隐藏删除按钮')">
31
31
  <el-switch v-model="optionModel.hideRemoveButton"></el-switch>
32
32
  </el-form-item>
33
+ <el-form-item :label="i18nt('隐藏下载按钮')">
34
+ <el-switch :value="hideDownloadButton" @change="handleHideDownloadChange"></el-switch>
35
+ </el-form-item>
33
36
 
34
37
  </div>
35
38
  </template>
36
39
 
37
40
  <script>
38
- import i18n from "../../../../../../components/xform/utils/i18n";
41
+ import i18n from "../../../../../../components/xform/utils/i18n";
39
42
 
40
- export default {
41
- name: "field-vabUpload-editor",
42
- mixins: [i18n],
43
- props: {
44
- designer: Object,
45
- selectedWidget: Object,
46
- optionModel: Object,
43
+ export default {
44
+ name: "field-vabUpload-editor",
45
+ mixins: [i18n],
46
+ props: {
47
+ designer: Object,
48
+ selectedWidget: Object,
49
+ optionModel: Object,
50
+ },
51
+ computed: {
52
+ hideDownloadButton() {
53
+ return this.optionModel.showDownload === false;
54
+ },
55
+ },
56
+ methods: {
57
+ handleHideDownloadChange(hidden) {
58
+ this.$set(this.optionModel, "showDownload", !hidden);
47
59
  },
48
- }
60
+ },
61
+ };
49
62
  </script>
50
63
 
51
64
  <style scoped>
@@ -40,6 +40,9 @@
40
40
  <el-form-item :label="i18nt('隐藏删除按钮')">
41
41
  <el-switch v-model="optionModel.hideRemoveButton"></el-switch>
42
42
  </el-form-item>
43
+ <el-form-item :label="i18nt('隐藏下载按钮')">
44
+ <el-switch :value="hideDownloadButton" @change="handleHideDownloadChange"></el-switch>
45
+ </el-form-item>
43
46
  </div>
44
47
  </template>
45
48
 
@@ -60,6 +63,16 @@ export default {
60
63
  deleteParam: ["dataId", "formCode", "param"],
61
64
  };
62
65
  },
66
+ computed: {
67
+ hideDownloadButton() {
68
+ return this.optionModel.showDownload === false;
69
+ },
70
+ },
71
+ methods: {
72
+ handleHideDownloadChange(hidden) {
73
+ this.$set(this.optionModel, "showDownload", !hidden);
74
+ },
75
+ },
63
76
  };
64
77
  </script>
65
78
 
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <el-form-item :label="i18nt('隐藏下载按钮')">
3
+ <el-switch :value="hideDownloadButton" @change="handleChange"></el-switch>
4
+ </el-form-item>
5
+ </template>
6
+
7
+ <script>
8
+ import i18n from "../../../../../components/xform/utils/i18n";
9
+
10
+ export default {
11
+ name: "showDownloadButton-editor",
12
+ mixins: [i18n],
13
+ props: {
14
+ designer: Object,
15
+ selectedWidget: Object,
16
+ optionModel: Object,
17
+ },
18
+ computed: {
19
+ hideDownloadButton() {
20
+ return this.optionModel.showDownloadButton === false;
21
+ },
22
+ },
23
+ methods: {
24
+ handleChange(hidden) {
25
+ this.$set(this.optionModel, "showDownloadButton", !hidden);
26
+ },
27
+ },
28
+ };
29
+ </script>
@@ -199,6 +199,7 @@ const COMMON_PROPERTIES = {
199
199
  colorClass: "colorClass-editor",
200
200
  downloadButtonFlag: "downloadButtonFlag-editor",
201
201
  showViewButton: "showViewButton-editor",
202
+ showDownloadButton: "showDownloadButton-editor",
202
203
  urlValueEnabled: "urlValueEnabled-editor",
203
204
  };
204
205
 
@@ -3171,6 +3171,7 @@ export const advancedFields = [
3171
3171
  limit: null,
3172
3172
  fileTypes: [],
3173
3173
  hideRemoveButton: false,
3174
+ showDownload: true,
3174
3175
  accessType: "1",
3175
3176
  entityTableCode: null,
3176
3177
  entityTableDesc: null,
@@ -3748,6 +3749,7 @@ export const advancedFields = [
3748
3749
  limit: null,
3749
3750
  fileTypes: [],
3750
3751
  showViewButton: true,
3752
+ showDownloadButton: true,
3751
3753
  accessType: "1",
3752
3754
  entityTableCode: null,
3753
3755
  entityTableDesc: null,
@@ -4497,6 +4499,7 @@ export const businessFields = [
4497
4499
  labelHidden: !0,
4498
4500
  limit: null,
4499
4501
  hideRemoveButton: false,
4502
+ showDownload: true,
4500
4503
  accessType: "1",
4501
4504
  entityTableCode: null,
4502
4505
  entityTableDesc: null,
@@ -92,6 +92,10 @@ export function registerSubApps(apps, options = {}) {
92
92
  const subAppMenus = options.subAppMenus || {};
93
93
  const mainAdapter = options.mainAdapter || createDefaultMainAdapter();
94
94
  const userInfo = options.userInfo || null;
95
+ // 按钮/菜单禁用名单(menuCode)。登录时已写入 user.dispermissions,这里做快照下发
96
+ const dispermissions = Array.isArray(options.dispermissions)
97
+ ? options.dispermissions.slice()
98
+ : [];
95
99
  microAppConfigs = {};
96
100
  (apps || []).forEach((app) => {
97
101
  const menus = subAppMenus[app.appCode] || [];
@@ -100,6 +104,7 @@ export function registerSubApps(apps, options = {}) {
100
104
  token: getToken(),
101
105
  lang: localStorage.getItem("i18n-lang") || "",
102
106
  userInfo,
107
+ dispermissions,
103
108
  mainAdapter,
104
109
  };
105
110
  const entry = resolveEntry(app.entry);
@@ -267,6 +267,8 @@ const actions = {
267
267
  registerSubApps(hostRegistryApps, {
268
268
  subAppMenus,
269
269
  userInfo: buildUserInfoSnapshot(rootState.user),
270
+ dispermissions:
271
+ (rootState.user && rootState.user.dispermissions) || [],
270
272
  });
271
273
  }
272
274
  return dispatch("setSidebarRoute", rows);