Commit 485787d1 by 米嘉伟

Merge branch 'dev_zwpt' of http://47.92.108.28/changchao/founder_vue into dev_zwpt

parents e237280c 58dbee52
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
/***/ /***/
}), }),
/***/ "./node_modules/core-js-pure/features/promise/index.js": /***/ "./node_modules/core-js-pure/features/promise/index.js":
/*!*************************************************************!*\ /*!*************************************************************!*\
!*** ./node_modules/core-js-pure/features/promise/index.js ***! !*** ./node_modules/core-js-pure/features/promise/index.js ***!
...@@ -507,7 +507,6 @@ ...@@ -507,7 +507,6 @@
var KEYS = 'keys'; var KEYS = 'keys';
var VALUES = 'values'; var VALUES = 'values';
var ENTRIES = 'entries'; var ENTRIES = 'entries';
var returnThis = function () { return this; }; var returnThis = function () { return this; };
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
...@@ -3893,7 +3892,6 @@ ...@@ -3893,7 +3892,6 @@
imagetracer.imageToSVG(imgUrl, function (svgstr) { imagetracer.imageToSVG(imgUrl, function (svgstr) {
var _svgstr$match = svgstr.match(/path[^>]*d="([^"]*)"/), var _svgstr$match = svgstr.match(/path[^>]*d="([^"]*)"/),
svgPath = _svgstr$match[1]; svgPath = _svgstr$match[1];
var iconObj = {}; var iconObj = {};
iconObj[file.name] = svgPath; iconObj[file.name] = svgPath;
_this2.registerIcons(iconObj); _this2.registerIcons(iconObj);
...@@ -3914,7 +3912,6 @@ ...@@ -3914,7 +3912,6 @@
*/ */
_drawAction: function _drawAction() { _drawAction: function _drawAction() {
var _this3 = this; var _this3 = this;
return (0, _tuiCodeSnippet.extend)({ return (0, _tuiCodeSnippet.extend)({
setDrawMode: function setDrawMode(type, settings) { setDrawMode: function setDrawMode(type, settings) {
_this3.stopDrawingMode(); _this3.stopDrawingMode();
...@@ -4262,6 +4259,7 @@ ...@@ -4262,6 +4259,7 @@
}, },
/* eslint-disable complexity */ /* eslint-disable complexity */
objectActivated: function objectActivated(obj) { objectActivated: function objectActivated(obj) {
_this12.activeObjectId = obj.id; _this12.activeObjectId = obj.id;
_this12.ui.changeHelpButtonEnabled('delete', true); _this12.ui.changeHelpButtonEnabled('delete', true);
...@@ -4279,7 +4277,6 @@ ...@@ -4279,7 +4277,6 @@
strokeWidth: obj.strokeWidth, strokeWidth: obj.strokeWidth,
fillColor: obj.fill fillColor: obj.fill
}); });
_this12.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height)); _this12.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));
} else if (obj.type === 'path' || obj.type === 'line') { } else if (obj.type === 'path' || obj.type === 'line') {
if (_this12.ui.submenu !== 'draw') { if (_this12.ui.submenu !== 'draw') {
...@@ -16014,6 +16011,7 @@ ...@@ -16014,6 +16011,7 @@
pcnt = (pcnt + 1) % path.points.length; pcnt = (pcnt + 1) % path.points.length;
} }
if (curvepass) { if (curvepass) {
return [{ return [{
type: 'L', type: 'L',
x1: path.points[seqstart].x, x1: path.points[seqstart].x,
...@@ -17863,7 +17861,7 @@ ...@@ -17863,7 +17861,7 @@
}, { }, {
key: '_attachGraphicsEvents', key: '_attachGraphicsEvents',
value: function _attachGraphicsEvents() { value: function _attachGraphicsEvents() {
var _graphics$on; var _graphics$on;
this._graphics.on((_graphics$on = {}, _defineProperty(_graphics$on, MOUSE_DOWN, this._handlers.mousedown), _defineProperty(_graphics$on, OBJECT_MOVED, this._handlers.objectMoved), _defineProperty(_graphics$on, OBJECT_SCALED, this._handlers.objectScaled), _defineProperty(_graphics$on, OBJECT_ROTATED, this._handlers.objectRotated), _defineProperty(_graphics$on, OBJECT_ACTIVATED, this._handlers.objectActivated), _defineProperty(_graphics$on, OBJECT_ADDED, this._handlers.objectAdded), _defineProperty(_graphics$on, OBJECT_MODIFIED, this._handlers.objectModified), _defineProperty(_graphics$on, ADD_TEXT, this._handlers.addText), _defineProperty(_graphics$on, ADD_OBJECT, this._handlers.addObject), _defineProperty(_graphics$on, TEXT_EDITING, this._handlers.textEditing), _defineProperty(_graphics$on, TEXT_CHANGED, this._handlers.textChanged), _defineProperty(_graphics$on, ICON_CREATE_RESIZE, this._handlers.iconCreateResize), _defineProperty(_graphics$on, ICON_CREATE_END, this._handlers.iconCreateEnd), _defineProperty(_graphics$on, SELECTION_CLEARED, this._handlers.selectionCleared), _defineProperty(_graphics$on, SELECTION_CREATED, this._handlers.selectionCreated), _graphics$on)); this._graphics.on((_graphics$on = {}, _defineProperty(_graphics$on, MOUSE_DOWN, this._handlers.mousedown), _defineProperty(_graphics$on, OBJECT_MOVED, this._handlers.objectMoved), _defineProperty(_graphics$on, OBJECT_SCALED, this._handlers.objectScaled), _defineProperty(_graphics$on, OBJECT_ROTATED, this._handlers.objectRotated), _defineProperty(_graphics$on, OBJECT_ACTIVATED, this._handlers.objectActivated), _defineProperty(_graphics$on, OBJECT_ADDED, this._handlers.objectAdded), _defineProperty(_graphics$on, OBJECT_MODIFIED, this._handlers.objectModified), _defineProperty(_graphics$on, ADD_TEXT, this._handlers.addText), _defineProperty(_graphics$on, ADD_OBJECT, this._handlers.addObject), _defineProperty(_graphics$on, TEXT_EDITING, this._handlers.textEditing), _defineProperty(_graphics$on, TEXT_CHANGED, this._handlers.textChanged), _defineProperty(_graphics$on, ICON_CREATE_RESIZE, this._handlers.iconCreateResize), _defineProperty(_graphics$on, ICON_CREATE_END, this._handlers.iconCreateEnd), _defineProperty(_graphics$on, SELECTION_CLEARED, this._handlers.selectionCleared), _defineProperty(_graphics$on, SELECTION_CREATED, this._handlers.selectionCreated), _graphics$on));
} }
...@@ -18812,6 +18810,7 @@ ...@@ -18812,6 +18810,7 @@
}, { }, {
key: 'changeShape', key: 'changeShape',
value: function changeShape(id, options, isSilent) { value: function changeShape(id, options, isSilent) {
var executeMethodName = isSilent ? 'executeSilent' : 'execute'; var executeMethodName = isSilent ? 'executeSilent' : 'execute';
return this[executeMethodName](_consts.commandNames.CHANGE_SHAPE, id, options); return this[executeMethodName](_consts.commandNames.CHANGE_SHAPE, id, options);
...@@ -18853,6 +18852,7 @@ ...@@ -18853,6 +18852,7 @@
}, { }, {
key: 'addText', key: 'addText',
value: function addText(text, options) { value: function addText(text, options) {
text = text || ''; text = text || '';
options = options || {}; options = options || {};
...@@ -18898,6 +18898,7 @@ ...@@ -18898,6 +18898,7 @@
}, { }, {
key: 'changeTextStyle', key: 'changeTextStyle',
value: function changeTextStyle(id, styleObj, isSilent) { value: function changeTextStyle(id, styleObj, isSilent) {
var executeMethodName = isSilent ? 'executeSilent' : 'execute'; var executeMethodName = isSilent ? 'executeSilent' : 'execute';
return this[executeMethodName](_consts.commandNames.CHANGE_TEXT_STYLE, id, styleObj); return this[executeMethodName](_consts.commandNames.CHANGE_TEXT_STYLE, id, styleObj);
...@@ -18940,6 +18941,7 @@ ...@@ -18940,6 +18941,7 @@
}, { }, {
key: '_onIconCreateResize', key: '_onIconCreateResize',
value: function _onIconCreateResize(originPointer) { value: function _onIconCreateResize(originPointer) {
this.fire(_consts.eventNames.ICON_CREATE_RESIZE, originPointer); this.fire(_consts.eventNames.ICON_CREATE_RESIZE, originPointer);
} }
...@@ -19016,11 +19018,15 @@ ...@@ -19016,11 +19018,15 @@
*/ */
}, { }, {
//获取不到对象在这里看
key: '_onAddObject', key: '_onAddObject',
value: function _onAddObject(objectProps) { value: function _onAddObject(objectProps) {
var obj = this._graphics.getObject(objectProps.id); var obj = this._graphics.getObject(objectProps.id);
this._invoker.fire(_consts.eventNames.EXECUTE_COMMAND, (0, _util.getObjectType)(obj.type)); this._invoker.fire(_consts.eventNames.EXECUTE_COMMAND, (0, _util.getObjectType)(obj.type));
this._pushAddObjectCommand(obj); this._pushAddObjectCommand(obj);
if(objectProps.type == 'path'){
this._onObjectAdded(objectProps);
}
} }
/** /**
...@@ -19032,6 +19038,7 @@ ...@@ -19032,6 +19038,7 @@
}, { }, {
key: '_onObjectAdded', key: '_onObjectAdded',
value: function _onObjectAdded(objectProps) { value: function _onObjectAdded(objectProps) {
/** /**
* The event when object added * The event when object added
* @event ImageEditor#objectAdded * @event ImageEditor#objectAdded
...@@ -20276,7 +20283,7 @@ ...@@ -20276,7 +20283,7 @@
var _this4 = this; var _this4 = this;
if (this._isLocked) { if (this._isLocked) {
return _util.Promise.reject(_consts.rejectMessages.isLock); // return _util.Promise.reject(_consts.rejectMessages.isLock);
} }
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
...@@ -1245,6 +1245,7 @@ div { ...@@ -1245,6 +1245,7 @@ div {
height: 750px; height: 750px;
display: flex; display: flex;
.source { .source {
z-index: 0;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 560px; width: 560px;
...@@ -1332,6 +1333,7 @@ div { ...@@ -1332,6 +1333,7 @@ div {
height: 750px; height: 750px;
background: #ffffff; background: #ffffff;
border-radius: 8px; border-radius: 8px;
z-index: 0;
border: 2px solid $targetB; border: 2px solid $targetB;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-09-09 09:28:46 * @Date: 2021-09-09 09:28:46
* @LastEditTime: 2021-11-03 15:12:59 * @LastEditTime: 2021-11-05 11:14:14
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\cxyrd\LTz.vue * @FilePath: \指纹系统\founder_vue\src\views\cxyrd\LTz.vue
...@@ -648,7 +648,14 @@ export default { ...@@ -648,7 +648,14 @@ export default {
isShowEnlargeSynchro: false, isShowEnlargeSynchro: false,
curveArr: [], curveArr: [],
// 对比度 // 对比度
inputContrastRange: 0 inputContrastRange: 0,
//源数据角度
startPlaceSource: 0,
//目标数据角度
startPlaceTarget: 0,
//target的曲线对象集合
path2: [],
path: []
}; };
}, },
components: { components: {
...@@ -919,9 +926,11 @@ export default { ...@@ -919,9 +926,11 @@ export default {
// Attach image editor custom events // Attach image editor custom events
imageEditor.on({ imageEditor.on({
objectAdded: function (objectProps) { objectAdded: function (objectProps) {
console.info(objectProps); console.log(objectProps,22222222);
if (objectProps.type == 'line') { if (objectProps.type == 'line') {
self.lines.push(objectProps) self.lines.push(objectProps)
}else if(objectProps.type == 'path'){
self.path.push(objectProps)
} }
// self.historys.push(objectProps.type) // self.historys.push(objectProps.type)
console.log(111); console.log(111);
...@@ -994,9 +1003,11 @@ export default { ...@@ -994,9 +1003,11 @@ export default {
imageEditor2.on({ imageEditor2.on({
objectAdded: function (objectProps) { objectAdded: function (objectProps) {
console.info(objectProps); console.log('imageEditor2======',objectProps)
if (objectProps.type == 'line') { if (objectProps.type == 'line') {
self.lines2.push(objectProps) self.lines2.push(objectProps)
}else if(objectProps.type == 'path'){
self.path2.push(objectProps)
} }
}, },
undoStackChanged: function (length) { undoStackChanged: function (length) {
...@@ -1477,6 +1488,7 @@ export default { ...@@ -1477,6 +1488,7 @@ export default {
self.isReset = true self.isReset = true
// 旋转角度同样恢复到0 // 旋转角度同样恢复到0
self.inputRotationRange = 0 self.inputRotationRange = 0
self.startPlaceSource = 0
// 事件不能连续重复执行,需要缓存时间 // 事件不能连续重复执行,需要缓存时间
setTimeout(() => { setTimeout(() => {
imageEditor.setAngle(0)['catch'](function () { }); imageEditor.setAngle(0)['catch'](function () { });
...@@ -1493,6 +1505,7 @@ export default { ...@@ -1493,6 +1505,7 @@ export default {
self.isReset = true self.isReset = true
// 旋转角度同样恢复到0 // 旋转角度同样恢复到0
self.inputRotationRange = 0 self.inputRotationRange = 0
self.startPlaceTarget = 0;
setTimeout(() => { setTimeout(() => {
imageEditor2.setAngle(0)['catch'](function () { }); imageEditor2.setAngle(0)['catch'](function () { });
}, 200); }, 200);
...@@ -1508,11 +1521,13 @@ export default { ...@@ -1508,11 +1521,13 @@ export default {
// 向左旋转30° // 向左旋转30°
$btnRotateClockwise.on('click', function () { $btnRotateClockwise.on('click', function () {
if (self.type == 'source') { if (self.type == 'source') {
self.startPlaceSource += 30;
self.isLeftRotate = true self.isLeftRotate = true
self.isRightRotate = false self.isRightRotate = false
imageEditor.rotate(30); imageEditor.rotate(30);
self.historys.push('旋转') self.historys.push('旋转')
} else { } else {
self.startPlaceTarget += 30;
self.isLeftRotate = true self.isLeftRotate = true
self.isRightRotate = false self.isRightRotate = false
imageEditor2.rotate(30); imageEditor2.rotate(30);
...@@ -1522,11 +1537,13 @@ export default { ...@@ -1522,11 +1537,13 @@ export default {
// 向右旋转30° // 向右旋转30°
$btnRotateCounterClockWise.on('click', function () { $btnRotateCounterClockWise.on('click', function () {
if (self.type == 'source') { if (self.type == 'source') {
self.startPlaceSource -= 30;
self.isLeftRotate = false self.isLeftRotate = false
self.isRightRotate = true self.isRightRotate = true
imageEditor.rotate(-30); imageEditor.rotate(-30);
self.historys.push('旋转') self.historys.push('旋转')
} else { } else {
self.startPlaceTarget -= 30;
self.isLeftRotate = false self.isLeftRotate = false
self.isRightRotate = true self.isRightRotate = true
imageEditor2.rotate(-30); imageEditor2.rotate(-30);
...@@ -1536,12 +1553,17 @@ export default { ...@@ -1536,12 +1553,17 @@ export default {
// 滑动旋转事件 // 滑动旋转事件
$inputRotationRange.on('mousedown', function () { $inputRotationRange.on('mousedown', function () {
var changeAngle = function () { var changeAngle = function () {
console.log('mousedown')
if (self.type == 'source') { if (self.type == 'source') {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlaceSource)
self.startPlaceSource = self.inputRotationRange;
} else { } else {
self.inputRotationRange2 = parseInt($inputRotationRange.val(), 10) self.inputRotationRange2 = parseInt($inputRotationRange.val(), 10)
imageEditor2.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor2.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlaceTarget)
self.startPlaceTarget = self.inputRotationRange2;
} }
}; };
$(document).on('mousemove', changeAngle); $(document).on('mousemove', changeAngle);
...@@ -1552,13 +1574,17 @@ export default { ...@@ -1552,13 +1574,17 @@ export default {
}); });
// 滑动旋转事件 // 滑动旋转事件
$inputRotationRange.on('change', function () { $inputRotationRange.on('change', function () {
console.log('change')
if (self.type == 'source') { if (self.type == 'source') {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlaceSource)
self.startPlaceSource = self.inputRotationRange;
self.historys.push('旋转') self.historys.push('旋转')
} else { } else {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor2.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); self.inputRotationRange2 = parseInt($inputRotationRange.val(), 10)
imageEditor2.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlaceTarget)
self.startPlaceTarget = self.inputRotationRange2;
self.historys2.push('旋转') self.historys2.push('旋转')
} }
}); });
...@@ -3106,18 +3132,32 @@ export default { ...@@ -3106,18 +3132,32 @@ export default {
self.imageEditor.removeObject(element.id) self.imageEditor.removeObject(element.id)
}, 200); }, 200);
}); });
self.path.forEach(element => {
setTimeout(() => {
self.imageEditor.removeObject(element.id)
}, 200);
});
console.log(self.lines); console.log(self.lines);
// 重置辅助线数组 // 重置辅助线数组
self.lines = [] self.lines = []
self.path = []
} else { } else {
//target对象直线
self.lines2.forEach(element => { self.lines2.forEach(element => {
setTimeout(() => { setTimeout(() => {
self.imageEditor2.removeObject(element.id) self.imageEditor2.removeObject(element.id)
}, 200); }, 200);
}); });
console.log(self.lines2); //target对象区线
self.path2.forEach(element => {
setTimeout(() => {
self.imageEditor2.removeObject(element.id)
}, 200);
});
// 重置辅助线数组 // 重置辅助线数组
self.lines2 = [] self.lines2 = [];
self.path2 = [];
} }
}, },
/** /**
...@@ -4756,10 +4796,19 @@ export default { ...@@ -4756,10 +4796,19 @@ export default {
} }
}, },
inputRotationRange (newValue, oldValue) { inputRotationRange (newValue, oldValue) {
let deg;
if (this.type == 'source') { if (this.type == 'source') {
this.imageEditor.setAngle(newValue)['catch'](function () { }); deg = newValue - this.startPlaceSource;
if(!deg) deg = 0;
this.imageEditor.rotate(deg);
this.startPlaceSource = newValue;
// this.imageEditor.setAngle(newValue)['catch'](function () { });
} else { } else {
this.imageEditor2.setAngle(newValue)['catch'](function () { }); deg = newValue - this.startPlaceTarget;
if(!deg) deg = 0;
this.imageEditor2.rotate(deg);
this.startPlaceTarget = newValue;
// this.imageEditor2.setAngle(newValue)['catch'](function () { });
} }
}, },
inputRemoveWhiteRange (newValue, oldValue) { inputRemoveWhiteRange (newValue, oldValue) {
...@@ -4855,6 +4904,16 @@ export default { ...@@ -4855,6 +4904,16 @@ export default {
}); });
}, 500); }, 500);
}) })
this.path.forEach((item) => {
setTimeout(() => {
self.imageEditor.setObjectPosition(item.id, {
x: -1000,
y: -1000,
originX: 'left',
originY: 'top'
});
}, 500);
})
} else { } else {
console.log(this.lines); console.log(this.lines);
this.lines.forEach((item) => { this.lines.forEach((item) => {
...@@ -4883,6 +4942,16 @@ export default { ...@@ -4883,6 +4942,16 @@ export default {
} }
}, 200); }, 200);
}) })
this.path.forEach((item) => {
setTimeout(() => {
self.imageEditor.setObjectPosition(item.id, {
x: item.left,
y: item.top,
originX: 'center',
originY: 'center'
});
}, 200);
})
} }
} else { } else {
if (newValue) { if (newValue) {
...@@ -4897,9 +4966,19 @@ export default { ...@@ -4897,9 +4966,19 @@ export default {
}); });
}, 500); }, 500);
}) })
this.path2.forEach((item) => {
setTimeout(() => {
self.imageEditor2.setObjectPosition(item.id, {
x: -1000,
y: -1000,
originX: 'left',
originY: 'top'
});
}, 500);
})
} else { } else {
console.log(this.lines2);
this.lines2.forEach((item) => { this.lines2.forEach((item) => {
//target对象直线的展示
setTimeout(() => { setTimeout(() => {
if ((item.endPosition.x - item.startPosition.x >= 0) && item.endPosition.y - item.startPosition.y >= 0) { if ((item.endPosition.x - item.startPosition.x >= 0) && item.endPosition.y - item.startPosition.y >= 0) {
self.imageEditor2.setObjectPosition(item.id, { self.imageEditor2.setObjectPosition(item.id, {
...@@ -4925,6 +5004,17 @@ export default { ...@@ -4925,6 +5004,17 @@ export default {
} }
}, 200); }, 200);
}) })
//target对象曲线的展示
this.path2.forEach((item) => {
setTimeout(() => {
self.imageEditor2.setObjectPosition(item.id, {
x: item.left,
y: item.top,
originX: 'center',
originY: 'center'
});
}, 200);
})
} }
} }
}, },
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-09-07 09:58:13 * @Date: 2021-09-07 09:58:13
* @LastEditTime: 2021-11-04 11:08:44 * @LastEditTime: 2021-11-04 09:26:19
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \founder_vue\src\router\modules\index.js * @FilePath: \founder_vue\src\router\modules\index.js
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-10-22 11:36:10 * @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-11-04 21:35:52 * @LastEditTime: 2021-11-05 11:51:32
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue * @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue
...@@ -988,6 +988,7 @@ export default { ...@@ -988,6 +988,7 @@ export default {
// 旋转角度同样恢复到0 // 旋转角度同样恢复到0
self.inputRotationRange = 0 self.inputRotationRange = 0
// 事件不能连续重复执行,需要缓存时间 // 事件不能连续重复执行,需要缓存时间
self.startPlace = 0;
setTimeout(() => { setTimeout(() => {
imageEditor.setAngle(0)['catch'](function () { }); imageEditor.setAngle(0)['catch'](function () { });
}, 200); }, 200);
...@@ -1002,36 +1003,31 @@ export default { ...@@ -1002,36 +1003,31 @@ export default {
// 向左旋转30° // 向左旋转30°
$btnRotateClockwise.on('click', function () { $btnRotateClockwise.on('click', function () {
self.startPlace += 30;
self.isLeftRotate = true self.isLeftRotate = true
self.isRightRotate = false self.isRightRotate = false
imageEditor.rotate(30); imageEditor.rotate(30);
self.historys.push('旋转') self.historys.push('旋转')
let canvasImage = imageEditor._graphics.getCanvasImage() let canvasImage = imageEditor._graphics.getCanvasImage()
// console.log(canvasImage); $('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`);
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`)
}); });
// 向右旋转30° // 向右旋转30°
$btnRotateCounterClockWise.on('click', function () { $btnRotateCounterClockWise.on('click', function () {
self.startPlace -= 30;
self.isLeftRotate = false self.isLeftRotate = false
self.isRightRotate = true self.isRightRotate = true
imageEditor.rotate(-30); imageEditor.rotate(-30);
let canvasImage = imageEditor._graphics.getCanvasImage() let canvasImage = imageEditor._graphics.getCanvasImage()
// console.log(canvasImage);
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`) $('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`)
self.historys.push('旋转') self.historys.push('旋转')
}); });
// 滑动旋转事件 // 滑动旋转事件
$inputRotationRange.on('mousedown', function () { $inputRotationRange.on('mousedown', function () {
self.startPlace = parseInt($inputRotationRange.val(), 10);
// console.log(self.startPlace)
var changeAngle = function () { var changeAngle = function () {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
// imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { });
imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace) imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace)
self.startPlace = self.inputRotationRange; self.startPlace = self.inputRotationRange;
// console.log(parseInt($inputRotationRange.val(), 10));
// let deg = (parseInt($inputRotationRange.val(), 10) * 180) / Math.PI - 90
// imageEditor.rotate(deg)
}; };
$(document).on('mousemove', changeAngle); $(document).on('mousemove', changeAngle);
$(document).on('mouseup', function stopChangingAngle () { $(document).on('mouseup', function stopChangingAngle () {
...@@ -1042,13 +1038,8 @@ export default { ...@@ -1042,13 +1038,8 @@ export default {
// 滑动旋转事件 // 滑动旋转事件
$inputRotationRange.on('change', function () { $inputRotationRange.on('change', function () {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
// imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { });
imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace) imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace)
self.startPlace = self.inputRotationRange; self.startPlace = self.inputRotationRange;
// console.log(parseInt($inputRotationRange.val(), 10));
// console.log(parseInt($inputRotationRange.val(), 10)); deg = (a * 180) / Math.PI - 90; //弧度转角度
// let deg = (parseInt($inputRotationRange.val(), 10) * 180) / Math.PI - 90
// imageEditor.rotate(deg)
self.historys.push('旋转') self.historys.push('旋转')
}); });
...@@ -3120,10 +3111,8 @@ export default { ...@@ -3120,10 +3111,8 @@ export default {
}, },
watch: { watch: {
inputRotationRange (newValue, oldValue) { inputRotationRange (newValue, oldValue) {
console.log(newValue)
let deg = newValue - this.startPlace; let deg = newValue - this.startPlace;
if(!deg) deg = 0; if(!deg) deg = 0;
// this.imageEditor.setAngle(0)['catch'](function () { });
this.imageEditor.rotate(deg) this.imageEditor.rotate(deg)
let canvasImage = this.imageEditor._graphics.getCanvasImage() let canvasImage = this.imageEditor._graphics.getCanvasImage()
this.startPlace = newValue; this.startPlace = newValue;
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-10-22 11:36:10 * @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-11-03 22:29:01 * @LastEditTime: 2021-11-05 11:32:22
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue * @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue
...@@ -648,7 +648,9 @@ export default { ...@@ -648,7 +648,9 @@ export default {
newWidth: 640, newWidth: 640,
// tzdDrawing 的移动距离 // tzdDrawing 的移动距离
tzdDrawingLeft: 0, tzdDrawingLeft: 0,
tzdDrawingTop: 0 tzdDrawingTop: 0,
//旋转之前的度数
startPlace: 0,
}; };
}, },
created () { created () {
...@@ -868,7 +870,6 @@ export default { ...@@ -868,7 +870,6 @@ export default {
}); });
}, },
objectActivated: function (obj) { objectActivated: function (obj) {
console.log(obj);
if (obj.type === 'circle') { if (obj.type === 'circle') {
// 存储标记点数据 // 存储标记点数据
self.circleArr.push(obj) self.circleArr.push(obj)
...@@ -877,8 +878,6 @@ export default { ...@@ -877,8 +878,6 @@ export default {
} }
}, },
mousedown: function (event, originPointer) { mousedown: function (event, originPointer) {
console.log(event);
console.log(originPointer);
if ($imageFilterSubMenu.is(':visible') && imageEditor.hasFilter('colorFilter')) { if ($imageFilterSubMenu.is(':visible') && imageEditor.hasFilter('colorFilter')) {
imageEditor.applyFilter('colorFilter', { imageEditor.applyFilter('colorFilter', {
x: parseInt(originPointer.x, 10), x: parseInt(originPointer.x, 10),
...@@ -970,6 +969,7 @@ export default { ...@@ -970,6 +969,7 @@ export default {
// 旋转角度同样恢复到0 // 旋转角度同样恢复到0
self.inputRotationRange = 0 self.inputRotationRange = 0
// 事件不能连续重复执行,需要缓存时间 // 事件不能连续重复执行,需要缓存时间
self.startPlace = 0;
setTimeout(() => { setTimeout(() => {
imageEditor.setAngle(0)['catch'](function () { }); imageEditor.setAngle(0)['catch'](function () { });
}, 200); }, 200);
...@@ -982,6 +982,7 @@ export default { ...@@ -982,6 +982,7 @@ export default {
// 向左旋转30° // 向左旋转30°
$btnRotateClockwise.on('click', function () { $btnRotateClockwise.on('click', function () {
self.startPlace += 30;
self.isLeftRotate = true self.isLeftRotate = true
self.isRightRotate = false self.isRightRotate = false
imageEditor.rotate(30); imageEditor.rotate(30);
...@@ -989,6 +990,7 @@ export default { ...@@ -989,6 +990,7 @@ export default {
}); });
// 向右旋转30° // 向右旋转30°
$btnRotateCounterClockWise.on('click', function () { $btnRotateCounterClockWise.on('click', function () {
self.startPlace -= 30;
self.isLeftRotate = false self.isLeftRotate = false
self.isRightRotate = true self.isRightRotate = true
imageEditor.rotate(-30); imageEditor.rotate(-30);
...@@ -998,8 +1000,8 @@ export default { ...@@ -998,8 +1000,8 @@ export default {
$inputRotationRange.on('mousedown', function () { $inputRotationRange.on('mousedown', function () {
var changeAngle = function () { var changeAngle = function () {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace)
// imageEditor.rotate(parseInt($inputRotationRange.val(), 10)) self.startPlace = self.inputRotationRange;
}; };
$(document).on('mousemove', changeAngle); $(document).on('mousemove', changeAngle);
$(document).on('mouseup', function stopChangingAngle () { $(document).on('mouseup', function stopChangingAngle () {
...@@ -1010,8 +1012,8 @@ export default { ...@@ -1010,8 +1012,8 @@ export default {
// 滑动旋转事件 // 滑动旋转事件
$inputRotationRange.on('change', function () { $inputRotationRange.on('change', function () {
self.inputRotationRange = parseInt($inputRotationRange.val(), 10) self.inputRotationRange = parseInt($inputRotationRange.val(), 10)
imageEditor.setAngle(parseInt($inputRotationRange.val(), 10))['catch'](function () { }); imageEditor.rotate(parseInt($inputRotationRange.val(), 10) - self.startPlace)
// imageEditor.rotate(parseInt($inputRotationRange.val(), 10)) self.startPlace = self.inputRotationRange;
self.historys.push('旋转') self.historys.push('旋转')
}); });
...@@ -2863,7 +2865,10 @@ export default { ...@@ -2863,7 +2865,10 @@ export default {
}); });
}, },
inputRotationRange (newValue, oldValue) { inputRotationRange (newValue, oldValue) {
this.imageEditor.setAngle(newValue)['catch'](function () { }); let deg = newValue - this.startPlace;
if(!deg) deg = 0;
this.imageEditor.rotate(deg)
this.startPlace = newValue;
}, },
inputRemoveWhiteRange (newValue, oldValue) { inputRemoveWhiteRange (newValue, oldValue) {
this.imageEditor.applyFilter('removeColor', { this.imageEditor.applyFilter('removeColor', {
......
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
<el-input <el-input
placeholder="请输入组描述" placeholder="请输入组描述"
class="input-info" class="input-info"
v-model="editFormParams.userId" v-model="editFormParams.groupdesc"
></el-input> ></el-input>
</el-form-item> </el-form-item>
...@@ -278,14 +278,14 @@ ...@@ -278,14 +278,14 @@
<el-input <el-input
placeholder="请选择组用户" placeholder="请选择组用户"
class="input-info" class="input-info"
v-model="editFormParams.roleId" v-model="editFormParams.userId"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item class="info-item" label="加入组角色:" prop="roleId"> <el-form-item class="info-item" label="加入组角色:" prop="roleId">
<el-input <el-input
placeholder="请选择组角色" placeholder="请选择组角色"
class="input-info" class="input-info"
v-model="editFormParams.okpassword" v-model="editFormParams.roleId"
></el-input> ></el-input>
</el-form-item> </el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment