|
@@ -5037,7 +5037,23 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { |
|
@@ -5037,7 +5037,23 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { |
5037
|
|
5037
|
|
5038
|
getToken()
|
5038
|
getToken()
|
5039
|
|
5039
|
|
5040
|
- //调用API,获取保存的内容
|
5040
|
+ var updateButtonContainer = this.updateButtonContainer
|
|
|
5041
|
+ // var lockUnlock = this.actions.actions.lockUnlock.funct
|
|
|
5042
|
+ // var selectAll = this.actions.actions.selectAll.funct
|
|
|
5043
|
+ function getUserPermission() {
|
|
|
5044
|
+ defHttp.get('/yt/role/me/permissions')
|
|
|
5045
|
+ .then(res => {
|
|
|
5046
|
+ USER_PERMISSION.permission = res
|
|
|
5047
|
+ updateButtonContainer()
|
|
|
5048
|
+ // var flag = hasSavePermission()
|
|
|
5049
|
+ // if (!flag) {
|
|
|
5050
|
+ // selectAll()
|
|
|
5051
|
+ // lockUnlock()
|
|
|
5052
|
+ // }
|
|
|
5053
|
+ })
|
|
|
5054
|
+ }
|
|
|
5055
|
+
|
|
|
5056
|
+ // 调用API,获取保存的内容
|
5041
|
function getSaveContent() {
|
5057
|
function getSaveContent() {
|
5042
|
defHttp.get('/yt/configuration/center/getConfigurationInfo/'+Editor.configurationId)
|
5058
|
defHttp.get('/yt/configuration/center/getConfigurationInfo/'+Editor.configurationId)
|
5043
|
.then(function (response) {
|
5059
|
.then(function (response) {
|
|
@@ -5085,6 +5101,8 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { |
|
@@ -5085,6 +5101,8 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { |
5085
|
} else {
|
5101
|
} else {
|
5086
|
fn();
|
5102
|
fn();
|
5087
|
}
|
5103
|
}
|
|
|
5104
|
+
|
|
|
5105
|
+ getUserPermission()
|
5088
|
})
|
5106
|
})
|
5089
|
.catch(function (error) {
|
5107
|
.catch(function (error) {
|
5090
|
console.log(error);
|
5108
|
console.log(error);
|
|
@@ -5960,27 +5978,31 @@ App.prototype.updateButtonContainer = function() |
|
@@ -5960,27 +5978,31 @@ App.prototype.updateButtonContainer = function() |
5960
|
this.buttonContainer.appendChild(this.shareButton);
|
5978
|
this.buttonContainer.appendChild(this.shareButton);
|
5961
|
|
5979
|
|
5962
|
// TODO thingsKit 保存按钮
|
5980
|
// TODO thingsKit 保存按钮
|
5963
|
- this.saveButton = document.createElement('div');
|
|
|
5964
|
- this.saveButton.className = 'geBtn gePrimaryBtn';
|
|
|
5965
|
- this.saveButton.style.display = 'inline-block';
|
|
|
5966
|
- this.saveButton.style.backgroundColor = '#F2931E';
|
|
|
5967
|
- this.saveButton.style.borderColor = '#F08705';
|
|
|
5968
|
- this.saveButton.style.backgroundImage = 'none';
|
|
|
5969
|
- this.saveButton.style.marginTop = '-10px';
|
|
|
5970
|
- this.saveButton.style.lineHeight = '28px';
|
|
|
5971
|
- this.saveButton.style.minWidth = '0px';
|
|
|
5972
|
- this.saveButton.style.cssFloat = 'right';
|
|
|
5973
|
- this.saveButton.setAttribute('title', '保存');
|
|
|
5974
|
- mxUtils.write(this.saveButton, '保存');
|
|
|
5975
|
- mxEvent.addListener(this.saveButton, 'click', mxUtils.bind(this, function()
|
|
|
5976
|
- {
|
|
|
5977
|
- this.currentFile.ui.actions.get(
|
|
|
5978
|
- (this.currentFile.mode == null || !this.currentFile.isEditable())
|
|
|
5979
|
- ? 'saveAs'
|
|
|
5980
|
- : 'save')
|
|
|
5981
|
- .funct();
|
|
|
5982
|
- }));
|
|
|
5983
|
- this.buttonContainer.appendChild(this.saveButton);
|
5981
|
+ var flag = hasSavePermission()
|
|
|
5982
|
+ if (flag) {
|
|
|
5983
|
+ this.saveButton = document.createElement('div');
|
|
|
5984
|
+ this.saveButton.className = 'geBtn gePrimaryBtn';
|
|
|
5985
|
+ this.saveButton.style.display = 'inline-block';
|
|
|
5986
|
+ this.saveButton.style.backgroundColor = '#F2931E';
|
|
|
5987
|
+ this.saveButton.style.borderColor = '#F08705';
|
|
|
5988
|
+ this.saveButton.style.backgroundImage = 'none';
|
|
|
5989
|
+ this.saveButton.style.marginTop = '-10px';
|
|
|
5990
|
+ this.saveButton.style.lineHeight = '28px';
|
|
|
5991
|
+ this.saveButton.style.minWidth = '0px';
|
|
|
5992
|
+ this.saveButton.style.cssFloat = 'right';
|
|
|
5993
|
+ this.saveButton.setAttribute('title', '保存');
|
|
|
5994
|
+ mxUtils.write(this.saveButton, '保存');
|
|
|
5995
|
+ mxEvent.addListener(this.saveButton, 'click', mxUtils.bind(this, function()
|
|
|
5996
|
+ {
|
|
|
5997
|
+ this.currentFile.ui.actions.get(
|
|
|
5998
|
+ (this.currentFile.mode == null || !this.currentFile.isEditable())
|
|
|
5999
|
+ ? 'saveAs'
|
|
|
6000
|
+ : 'save')
|
|
|
6001
|
+ .funct();
|
|
|
6002
|
+ }));
|
|
|
6003
|
+ this.buttonContainer.appendChild(this.saveButton);
|
|
|
6004
|
+ }
|
|
|
6005
|
+
|
5984
|
|
6006
|
|
5985
|
|
6007
|
|
5986
|
// this.shareButton = document.createElement('div');
|
6008
|
// this.shareButton = document.createElement('div');
|