cloud-web-corejs 1.0.54-dev.196 → 1.0.54-dev.198
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/excelExport/mixins.js +3 -1
- package/src/components/table/index.js +3 -3
- package/src/components/table/index2.js +1371 -0
- package/src/components/table/util/index.js +328 -0
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +4 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +7 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +8 -2
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +6 -0
- package/src/layout/components/AppMain.vue +5 -1
- package/src/layout/components/watermark/index.vue +77 -0
- package/src/views/bd/setting/bd_attach_setting/edit.vue +2 -2
- package/src/views/bd/setting/bd_attach_setting/mixins/list.js +219 -1
- package/src/views/bd/setting/form_script/edit.vue +2 -2
- package/src/views/bd/setting/form_script/edit1.vue +2 -2
- package/src/views/bd/setting/form_script/mixins/form_list.js +283 -1
- package/src/views/bd/setting/form_script/mixins/list.js +191 -1
- package/src/views/bd/setting/form_script/mixins/list1.js +347 -1
- package/src/views/bd/setting/form_template/edit.vue +2 -2
- package/src/views/bd/setting/form_template/mixins/list.js +600 -1
- package/src/views/bd/setting/table_model/mixins/list.js +365 -1
- package/src/views/user/login/default.vue +31 -2
- package/src/views/user/login/indexMixin.js +114 -3
- package/src/views/user/project_tag/list.vue +9 -4
- package/src/views/user/login/index2.vue +0 -131
@@ -0,0 +1,328 @@
|
|
1
|
+
import Vue from "vue";
|
2
|
+
import CellSlot from "@base/components/table/CellSlot.vue";
|
3
|
+
|
4
|
+
let instance = null;
|
5
|
+
|
6
|
+
let TempSoltConstructor = Vue.extend(CellSlot);
|
7
|
+
|
8
|
+
function initTempSoltConstructorInstance() {
|
9
|
+
if (!instance) {
|
10
|
+
instance = new TempSoltConstructor();
|
11
|
+
}
|
12
|
+
return instance;
|
13
|
+
}
|
14
|
+
|
15
|
+
function destroyTempSoltConstructorInstance() {
|
16
|
+
if (instance) {
|
17
|
+
instance.$destroy();
|
18
|
+
instance = null;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
export function getCellValue(obj) {
|
23
|
+
let {column, $table} = obj;
|
24
|
+
let params = createParams(obj);
|
25
|
+
let h = $table.$createElement;
|
26
|
+
let that = $table.$xegrid.originOption.vue;
|
27
|
+
|
28
|
+
let cellValue;
|
29
|
+
if (column.slots && column.slots.filterVal) {
|
30
|
+
cellValue = column.slots.filterVal(params);
|
31
|
+
} else {
|
32
|
+
let result = column.renderCell(h, params);
|
33
|
+
cellValue = vNodeRender(result);
|
34
|
+
}
|
35
|
+
return cellValue;
|
36
|
+
}
|
37
|
+
|
38
|
+
export function createParams(obj) {
|
39
|
+
let $xetable = obj.$table;
|
40
|
+
let {column, row} = obj;
|
41
|
+
let fixedType = $xetable.$refs.tableBody.fixedType,
|
42
|
+
afterFullData = $xetable.afterFullData,
|
43
|
+
tableData = $xetable.tableData;
|
44
|
+
var columnIndex = $xetable.getColumnIndex(column);
|
45
|
+
let items = tableData;
|
46
|
+
|
47
|
+
var _columnIndex = $xetable.getVTColumnIndex(column);
|
48
|
+
|
49
|
+
let overflowX = $xetable.overflowX;
|
50
|
+
var fixedHiddenColumn = fixedType
|
51
|
+
? column.fixed !== fixedType
|
52
|
+
: column.fixed && overflowX;
|
53
|
+
|
54
|
+
let tableColumn = $xetable.tableColumn,
|
55
|
+
scrollXLoad = $xetable.scrollXLoad,
|
56
|
+
scrollYLoad = $xetable.scrollYLoad,
|
57
|
+
allColumnOverflow = $xetable.showOverflow,
|
58
|
+
isAllOverflow = $xetable.isAllOverflow,
|
59
|
+
mergeList = $xetable.mergeList,
|
60
|
+
spanMethod = $xetable.spanMethod,
|
61
|
+
keyboardConfig = $xetable.keyboardConfig,
|
62
|
+
keyboardOpts = $xetable.keyboardOpts,
|
63
|
+
fixedColumn = $xetable.$refs.tableBody.fixedColumn,
|
64
|
+
visibleColumn = $xetable.visibleColumn;
|
65
|
+
|
66
|
+
if (obj.tableColumn == null) {
|
67
|
+
if (fixedType) {
|
68
|
+
if (
|
69
|
+
scrollXLoad
|
70
|
+
|| scrollYLoad
|
71
|
+
|| (allColumnOverflow ? isAllOverflow : allColumnOverflow)
|
72
|
+
) {
|
73
|
+
if (
|
74
|
+
!mergeList.length
|
75
|
+
&& !spanMethod
|
76
|
+
&& !(keyboardConfig && keyboardOpts.isMerge)
|
77
|
+
) {
|
78
|
+
tableColumn = fixedColumn;
|
79
|
+
} else {
|
80
|
+
tableColumn = visibleColumn; // 检查固定列是否被合并,合并范围是否超出固定列
|
81
|
+
// if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
|
82
|
+
// tableColumn = fixedColumn
|
83
|
+
// } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
|
84
|
+
// tableColumn = fixedColumn
|
85
|
+
// } else {
|
86
|
+
// tableColumn = visibleColumn
|
87
|
+
// }
|
88
|
+
}
|
89
|
+
} else {
|
90
|
+
tableColumn = visibleColumn;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
} else {
|
94
|
+
tableColumn = obj.tableColumn;
|
95
|
+
}
|
96
|
+
|
97
|
+
var rowid = $xetable.getRowid(row);
|
98
|
+
let fullAllDataRowIdData = $xetable.fullAllDataRowIdData;
|
99
|
+
var rest = fullAllDataRowIdData[rowid];
|
100
|
+
var rowLevel = rest ? rest.level : 0;
|
101
|
+
var seq = rest ? rest.seq : -1;
|
102
|
+
var renderType = "body";
|
103
|
+
|
104
|
+
let $rowIndex = obj.$rowIndex;
|
105
|
+
if ($rowIndex == null) {
|
106
|
+
tableData.some(function (item, index) {
|
107
|
+
let flag = rowid == $xetable.getRowid(item);
|
108
|
+
if (flag) {
|
109
|
+
$rowIndex = index;
|
110
|
+
}
|
111
|
+
return flag;
|
112
|
+
});
|
113
|
+
}
|
114
|
+
|
115
|
+
let $columnIndex = obj.$columnIndex;
|
116
|
+
if ($columnIndex == null) {
|
117
|
+
tableColumn.some(function (item, index) {
|
118
|
+
let flag = column.id == item.id;
|
119
|
+
if (flag) {
|
120
|
+
$columnIndex = index;
|
121
|
+
}
|
122
|
+
return flag;
|
123
|
+
});
|
124
|
+
}
|
125
|
+
|
126
|
+
var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
127
|
+
var rowIndex = $xetable.getRowIndex(row); // 事件绑定
|
128
|
+
var params = {
|
129
|
+
$table: $xetable,
|
130
|
+
seq: seq,
|
131
|
+
rowid: rowid,
|
132
|
+
row: row,
|
133
|
+
rowIndex: rowIndex,
|
134
|
+
$rowIndex: $rowIndex,
|
135
|
+
_rowIndex: _rowIndex,
|
136
|
+
column: column,
|
137
|
+
columnIndex: columnIndex,
|
138
|
+
$columnIndex: $columnIndex,
|
139
|
+
_columnIndex: _columnIndex,
|
140
|
+
fixed: fixedType,
|
141
|
+
type: renderType,
|
142
|
+
isHidden: fixedHiddenColumn,
|
143
|
+
level: rowLevel,
|
144
|
+
visibleData: afterFullData,
|
145
|
+
data: tableData,
|
146
|
+
items: items,
|
147
|
+
};
|
148
|
+
return params;
|
149
|
+
}
|
150
|
+
|
151
|
+
function vNodeRender(vNodes) {
|
152
|
+
if (vNodes === null || vNodes === undefined) {
|
153
|
+
return null;
|
154
|
+
}
|
155
|
+
let type = typeof vNodes;
|
156
|
+
if (type == "string" || type == "number") {
|
157
|
+
return vNodes;
|
158
|
+
}
|
159
|
+
|
160
|
+
let cellValue = "";
|
161
|
+
let contents = [];
|
162
|
+
// let instance = null;
|
163
|
+
let loop = function (item) {
|
164
|
+
if (item && item.children && item.children.length > 0) {
|
165
|
+
let arr = [];
|
166
|
+
item.children.forEach(function (child) {
|
167
|
+
if (child.componentOptions) {
|
168
|
+
initTempSoltConstructorInstance();
|
169
|
+
instance.$slots.default = child;
|
170
|
+
instance.$mount();
|
171
|
+
cellValue = "";
|
172
|
+
if (child.componentInstance && child.componentInstance.$el) {
|
173
|
+
cellValue = domRender(child.componentInstance.$el);
|
174
|
+
}
|
175
|
+
arr.push(cellValue);
|
176
|
+
instance.$slots.default = null;
|
177
|
+
} else {
|
178
|
+
let text = loop(child);
|
179
|
+
if (text != null) {
|
180
|
+
arr.push(text);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
});
|
184
|
+
return arr.join("");
|
185
|
+
} else {
|
186
|
+
if (item.text != null) {
|
187
|
+
return item.text;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
};
|
191
|
+
|
192
|
+
vNodes.forEach(function (vNode) {
|
193
|
+
if (vNode !== undefined && vNode !== null) {
|
194
|
+
if (vNode.componentOptions) {
|
195
|
+
initTempSoltConstructorInstance();
|
196
|
+
instance.$slots.default = vNode;
|
197
|
+
instance.$mount();
|
198
|
+
cellValue = "";
|
199
|
+
if (vNode.componentInstance && vNode.componentInstance.$el) {
|
200
|
+
cellValue = domRender(vNode.componentInstance.$el);
|
201
|
+
}
|
202
|
+
contents.push(cellValue);
|
203
|
+
// instance.$destroy();
|
204
|
+
instance.$slots.default = null;
|
205
|
+
// instance = null;
|
206
|
+
} else {
|
207
|
+
if (vNode && vNode.children && vNode.children.length > 0) {
|
208
|
+
let text = loop(vNode);
|
209
|
+
if (text != null) {
|
210
|
+
contents.push(text);
|
211
|
+
}
|
212
|
+
} else {
|
213
|
+
let type1 = typeof vNode;
|
214
|
+
if (type1 == "string" || type1 == "number") {
|
215
|
+
contents.push(vNode);
|
216
|
+
} else if (vNode.text != null) {
|
217
|
+
contents.push(vNode.text);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
});
|
223
|
+
destroyTempSoltConstructorInstance();
|
224
|
+
// instance = null;
|
225
|
+
return contents.join("").trim();
|
226
|
+
}
|
227
|
+
|
228
|
+
function groupDomRender(dom) {
|
229
|
+
let contents = [];
|
230
|
+
let loop = function (item) {
|
231
|
+
if (item && item.children && item.children.length > 0) {
|
232
|
+
let arr = [];
|
233
|
+
Array.from(item.children).forEach((child) => {
|
234
|
+
let text = loop(child);
|
235
|
+
if (text != null) {
|
236
|
+
arr.push(text);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
return arr.join("");
|
240
|
+
} else {
|
241
|
+
var style = window.getComputedStyle(item); //el即DOM元素
|
242
|
+
let classList = Array.from(item.classList);
|
243
|
+
if (style.display === "none") {
|
244
|
+
} else if (item.nodeName == "INPUT") {
|
245
|
+
if (item.type == "radio") {
|
246
|
+
if (item.checked && classList.includes("el-radio__original")) {
|
247
|
+
let value = item.parentNode.parentNode.innerText || "";
|
248
|
+
if (value) {
|
249
|
+
contents.push(value);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
} else if (item.type == "checkbox") {
|
253
|
+
if (item.checked && classList.includes("el-checkbox__original")) {
|
254
|
+
let value = item.parentNode.parentNode.innerText || "";
|
255
|
+
if (value) {
|
256
|
+
contents.push(value);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}
|
260
|
+
}
|
261
|
+
}
|
262
|
+
};
|
263
|
+
loop(dom);
|
264
|
+
return contents.join(",");
|
265
|
+
}
|
266
|
+
|
267
|
+
function selectGroupRender(dom) {
|
268
|
+
let ul = dom.querySelector(".el-select-dropdown__list");
|
269
|
+
if (ul) {
|
270
|
+
let lis = ul.children;
|
271
|
+
if (lis) {
|
272
|
+
return Array.from(lis)
|
273
|
+
.filter((li) => {
|
274
|
+
let classList = Array.from(li.classList);
|
275
|
+
return classList.includes("selected");
|
276
|
+
})
|
277
|
+
.map((li) => {
|
278
|
+
return li.innerText;
|
279
|
+
})
|
280
|
+
.join(",");
|
281
|
+
} else {
|
282
|
+
return "";
|
283
|
+
}
|
284
|
+
} else {
|
285
|
+
return "";
|
286
|
+
}
|
287
|
+
}
|
288
|
+
|
289
|
+
function domRender(dom) {
|
290
|
+
let loop = function (item) {
|
291
|
+
if(item?.nodeName=="#comment")return "";
|
292
|
+
var style = window.getComputedStyle(item); //el即DOM元素
|
293
|
+
let role = item.getAttribute("role");
|
294
|
+
let classList = Array.from(item.classList);
|
295
|
+
|
296
|
+
if (style.display === "none") {
|
297
|
+
return "";
|
298
|
+
} else if (role == "group") {
|
299
|
+
return groupDomRender(item);
|
300
|
+
} else if (role == "radiogroup") {
|
301
|
+
return groupDomRender(item);
|
302
|
+
} else if (
|
303
|
+
classList.includes("el-select")
|
304
|
+
&& item["@@clickoutsideContext"]
|
305
|
+
) {
|
306
|
+
return selectGroupRender(item);
|
307
|
+
} else if (item && item.children && item.children.length > 0) {
|
308
|
+
let arr = [];
|
309
|
+
Array.from(item.children).forEach((child) => {
|
310
|
+
let text = loop(child);
|
311
|
+
if (text != null) {
|
312
|
+
arr.push(text);
|
313
|
+
}
|
314
|
+
});
|
315
|
+
return arr.join("");
|
316
|
+
} else {
|
317
|
+
if (item.nodeName == "INPUT") {
|
318
|
+
return item.value;
|
319
|
+
} else if (item.innerText != null && item.innerText != "") {
|
320
|
+
return item.innerText;
|
321
|
+
} else {
|
322
|
+
return "";
|
323
|
+
}
|
324
|
+
}
|
325
|
+
};
|
326
|
+
let res = loop(dom).trim();
|
327
|
+
return res;
|
328
|
+
}
|
@@ -176,6 +176,9 @@ export default {
|
|
176
176
|
},
|
177
177
|
|
178
178
|
labelAlign() {
|
179
|
+
if (!this?.field?.options?.labelAlign) {
|
180
|
+
return ""
|
181
|
+
}
|
179
182
|
if (!!this.field.options.labelAlign) {
|
180
183
|
return this.field.options.labelAlign
|
181
184
|
}
|
@@ -299,6 +302,7 @@ export default {
|
|
299
302
|
let that = this.$parent
|
300
303
|
let formRef = that.getFormRef ? that.getFormRef() : that;
|
301
304
|
|
305
|
+
if(!formRef)return
|
302
306
|
//详情页,新增页面不加密
|
303
307
|
let fJson = formRef.formJson;
|
304
308
|
let formConfig = fJson.formConfig;
|
@@ -9,16 +9,20 @@
|
|
9
9
|
<el-form-item label="文件大小限制(M)">
|
10
10
|
<base-input-number v-model="optionModel.importFileLimitSize" :max="200"></base-input-number>
|
11
11
|
</el-form-item>
|
12
|
-
<el-form-item label="
|
12
|
+
<el-form-item label="导入模板文件编码">
|
13
13
|
<el-input
|
14
14
|
class="search-input"
|
15
15
|
max="200"
|
16
|
-
|
16
|
+
:value="optionModel.importAttachCode"
|
17
17
|
clearable
|
18
|
+
@clear="optionModel.importAttachCode=null;optionModel.importAttachName=null;"
|
18
19
|
>
|
19
20
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="showBdAttachSettingDialog = true"></i>
|
20
21
|
</el-input>
|
21
22
|
</el-form-item>
|
23
|
+
<el-form-item label="导入模板文件名称">
|
24
|
+
<span>{{optionModel.importAttachName}}</span>
|
25
|
+
</el-form-item>
|
22
26
|
<el-form-item label="关联表格唯一名称">
|
23
27
|
<el-input v-model="optionModel.tableRef"></el-input>
|
24
28
|
</el-form-item>
|
@@ -77,6 +81,7 @@ export default {
|
|
77
81
|
confirmBdAttachSettingDialog(rows) {
|
78
82
|
if (rows.length) {
|
79
83
|
let row = rows[0];
|
84
|
+
this.optionModel.importAttachName = row.name;
|
80
85
|
this.optionModel.importAttachCode = row.code;
|
81
86
|
}
|
82
87
|
}
|
@@ -6,16 +6,21 @@
|
|
6
6
|
<el-form-item label="文件大小限制(M)">
|
7
7
|
<base-input-number v-model="optionModel.importFileLimitSize" :max="200"></base-input-number>
|
8
8
|
</el-form-item>
|
9
|
-
<el-form-item label="
|
9
|
+
<el-form-item label="导入模板文件编码">
|
10
10
|
<el-input
|
11
11
|
class="search-input"
|
12
12
|
max="200"
|
13
|
-
|
13
|
+
:value="optionModel.importAttachCode"
|
14
14
|
clearable
|
15
|
+
@clear="optionModel.importAttachCode=null;optionModel.importAttachName=null;"
|
15
16
|
>
|
16
17
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="showBdAttachSettingDialog = true"></i>
|
17
18
|
</el-input>
|
18
19
|
</el-form-item>
|
20
|
+
<el-form-item label="导入模板文件名称">
|
21
|
+
<span>{{ optionModel.importAttachName }}</span>
|
22
|
+
</el-form-item>
|
23
|
+
|
19
24
|
<el-form-item label="关联表格唯一名称">
|
20
25
|
<el-input v-model="optionModel.tableRef"></el-input>
|
21
26
|
</el-form-item>
|
@@ -70,6 +75,7 @@ export default {
|
|
70
75
|
confirmBdAttachSettingDialog(rows) {
|
71
76
|
if (rows.length) {
|
72
77
|
let row = rows[0];
|
78
|
+
this.optionModel.importAttachName = row.name;
|
73
79
|
this.optionModel.importAttachCode = row.code;
|
74
80
|
}
|
75
81
|
}
|
@@ -1781,6 +1781,7 @@ export const basicFields = [
|
|
1781
1781
|
tableData: {}
|
1782
1782
|
},
|
1783
1783
|
...defaultWfConfig,
|
1784
|
+
hiddenByWf: true,
|
1784
1785
|
...defaultWidgetShowRuleConfig,
|
1785
1786
|
|
1786
1787
|
showRuleFlag: 1,
|
@@ -2865,6 +2866,7 @@ export const advancedFields = [
|
|
2865
2866
|
...defaultSearchDialogConfig
|
2866
2867
|
},
|
2867
2868
|
...defaultWfConfig,
|
2869
|
+
hiddenByWf: true,
|
2868
2870
|
...defaultWidgetShowRuleConfig,
|
2869
2871
|
showRuleFlag: 1,
|
2870
2872
|
showRuleEnabled: 1,
|
@@ -2900,10 +2902,12 @@ export const advancedFields = [
|
|
2900
2902
|
...defaultSearchDialogConfig
|
2901
2903
|
},
|
2902
2904
|
...defaultWfConfig,
|
2905
|
+
hiddenByWf: true,
|
2903
2906
|
...defaultWidgetShowRuleConfig,
|
2904
2907
|
importFileLimitSize: 200,
|
2905
2908
|
importEntity: '',
|
2906
2909
|
importAttachCode: '',
|
2910
|
+
importAttachName: '',
|
2907
2911
|
importScriptCode: '',
|
2908
2912
|
onBeforeImport: '',
|
2909
2913
|
enabledImportPreHandle: false,
|
@@ -2944,10 +2948,12 @@ export const advancedFields = [
|
|
2944
2948
|
...defaultSearchDialogConfig
|
2945
2949
|
},
|
2946
2950
|
...defaultWfConfig,
|
2951
|
+
hiddenByWf: true,
|
2947
2952
|
...defaultWidgetShowRuleConfig,
|
2948
2953
|
frontImportFlag: 1,
|
2949
2954
|
importFileLimitSize: 200,
|
2950
2955
|
importAttachCode: '',
|
2956
|
+
importAttachName: '',
|
2951
2957
|
tableRef: '',
|
2952
2958
|
onConfirmImportEnabled: false,
|
2953
2959
|
onConfirmImport: '',
|
@@ -20,12 +20,15 @@
|
|
20
20
|
></outLink>
|
21
21
|
</template>
|
22
22
|
<unreadDialog></unreadDialog>
|
23
|
+
<watermark></watermark>
|
23
24
|
</section>
|
24
25
|
</template>
|
25
26
|
|
26
27
|
<script>
|
27
28
|
import outLink from '@base/views/user/outLink/index.vue';
|
28
29
|
import unreadDialog from "../../layout/components/notify_message/unreadDialog.vue";
|
30
|
+
import watermark from "./watermark";
|
31
|
+
|
29
32
|
|
30
33
|
export default {
|
31
34
|
name: 'AppMain',
|
@@ -43,7 +46,8 @@ export default {
|
|
43
46
|
},
|
44
47
|
components: {
|
45
48
|
outLink,
|
46
|
-
unreadDialog
|
49
|
+
unreadDialog,
|
50
|
+
watermark
|
47
51
|
},
|
48
52
|
data() {
|
49
53
|
return {
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="watermarkFlag" :style="'background:url('+imgUrl+')'"></div>
|
3
|
+
</template>
|
4
|
+
<script>
|
5
|
+
import {
|
6
|
+
getParameterVauleByCode,
|
7
|
+
} from '@base/api/user'
|
8
|
+
|
9
|
+
export default {
|
10
|
+
data() {
|
11
|
+
return {
|
12
|
+
imgUrl: null,
|
13
|
+
}
|
14
|
+
},
|
15
|
+
created() {
|
16
|
+
this.init();
|
17
|
+
},
|
18
|
+
methods: {
|
19
|
+
init() {
|
20
|
+
getParameterVauleByCode({
|
21
|
+
data: {"code": "showWatermark"},
|
22
|
+
success: res => {
|
23
|
+
let value = (!res.objx || !res.objx.value) ? "0" : res.objx.value;
|
24
|
+
if (value == "1") {
|
25
|
+
this.watermarkImg();
|
26
|
+
}
|
27
|
+
}
|
28
|
+
})
|
29
|
+
},
|
30
|
+
watermarkImg() {
|
31
|
+
let that = this
|
32
|
+
const testName = this.$store.getters.nickName
|
33
|
+
var nameL = ''
|
34
|
+
if (testName.match(/[^\x00-\xff]/ig) != null){
|
35
|
+
nameL = testName.length
|
36
|
+
}else{
|
37
|
+
nameL = testName.length / 2
|
38
|
+
}
|
39
|
+
// 通过canvas将文本生成图片
|
40
|
+
const canvas = document.createElement('canvas')
|
41
|
+
canvas.width = nameL * 32 * 2
|
42
|
+
canvas.height = nameL * 32
|
43
|
+
const ctx = canvas.getContext('2d')
|
44
|
+
|
45
|
+
ctx.font = '18px PingFangSC'
|
46
|
+
ctx.textAlign = 'center'
|
47
|
+
ctx.fillStyle = '#EEEEEE'
|
48
|
+
// 设置倾斜角度
|
49
|
+
ctx.rotate(-30 * Math.PI / 180)
|
50
|
+
// 调整偏移量,让文本完整显示
|
51
|
+
ctx.translate(-50, 30)
|
52
|
+
ctx.fillText(testName, 100, 58)
|
53
|
+
// 将canvas转为base64图片
|
54
|
+
const url = canvas.toDataURL()
|
55
|
+
that.imgUrl = url
|
56
|
+
console.log(that.imgUrl)
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
</script>
|
61
|
+
<style scoped>
|
62
|
+
.watermarkFlag {
|
63
|
+
/* 设置全屏宽高,覆盖于页面上方 */
|
64
|
+
position: fixed;
|
65
|
+
top: 0;
|
66
|
+
left: 0;
|
67
|
+
height: 100vh;
|
68
|
+
width: 100vw;
|
69
|
+
opacity: 0.8;
|
70
|
+
/* 生成的图片是有一张,开启repeat自动填充 */
|
71
|
+
background: repeat;
|
72
|
+
pointer-events: none;
|
73
|
+
/* 核心部分,决定水印层与内容部分的结合方式 */
|
74
|
+
mix-blend-mode: multiply;
|
75
|
+
z-index: 9999999;
|
76
|
+
}
|
77
|
+
</style>
|
@@ -92,11 +92,11 @@
|
|
92
92
|
</tr>
|
93
93
|
<tr>
|
94
94
|
<th>{{ $t1('创建人') }}</th>
|
95
|
-
<td>{{ bdAttachSetting.
|
95
|
+
<td>{{ bdAttachSetting._createBy }}</td>
|
96
96
|
<th>{{ $t1('创建时间') }}</th>
|
97
97
|
<td>{{ bdAttachSetting.createDate }}</td>
|
98
98
|
<th>{{ $t1('更新人') }}</th>
|
99
|
-
<td>{{ bdAttachSetting.
|
99
|
+
<td>{{ bdAttachSetting._modifyBy }}</td>
|
100
100
|
<th>{{ $t1('更新时间') }}</th>
|
101
101
|
<td>{{ bdAttachSetting.modifyDate }}</td>
|
102
102
|
</tr>
|