|
|
@@ -195,7 +195,10 @@
|
|
|
class="form-control"
|
|
|
:disabled="isdisable"
|
|
|
>
|
|
|
- <option v-for="depreciationMethodDto in depreciationMethodDtos" :key="depreciationMethodDto.id">
|
|
|
+ <option
|
|
|
+ v-for="depreciationMethodDto in depreciationMethodDtos"
|
|
|
+ :key="depreciationMethodDto.id"
|
|
|
+ >
|
|
|
{{ depreciationMethodDto.text }}
|
|
|
</option>
|
|
|
</select>
|
|
|
@@ -489,6 +492,15 @@
|
|
|
:disabled="isdisable"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <a-button
|
|
|
+ style="margin-bottom: 15px"
|
|
|
+ :disabled="isdisable"
|
|
|
+ @click="initPostgreSQL"
|
|
|
+ >
|
|
|
+ 【初始化资产监控PostgreSQL时序数据库】
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -623,10 +635,6 @@
|
|
|
<script>
|
|
|
import Common from '../common/Common.js';
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
import ImageEditor from '../widget/ImageEditor.vue';
|
|
|
|
|
|
import LoginContextResource from '../api/base/LoginContextResource.js';
|
|
|
@@ -635,16 +643,8 @@ import AssetInstanceResource from '../api/asset/AssetInstanceResource.js';
|
|
|
import DepreciationMethodResource from '../api/asset/DepreciationMethodResource.js';
|
|
|
import { Notify } from 'pc-component-v3';
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
export default {
|
|
|
-
|
|
|
components: {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
ImageEditor,
|
|
|
},
|
|
|
data: function () {
|
|
|
@@ -690,10 +690,10 @@ export default {
|
|
|
var _self = this;
|
|
|
LoginContextResource.queryLoginContext().then(
|
|
|
successData => {
|
|
|
- if(successData.errorCode == 0) {
|
|
|
+ if (successData.errorCode == 0) {
|
|
|
_self.loginContextDto = successData.data;
|
|
|
} else {
|
|
|
- Notify.error('提示',successData.errorMessage, false);
|
|
|
+ Notify.error('提示', successData.errorMessage, false);
|
|
|
}
|
|
|
},
|
|
|
errorData => {
|
|
|
@@ -726,10 +726,12 @@ export default {
|
|
|
var _self = this;
|
|
|
AssetConfigResource.queryAssetConfig().then(
|
|
|
successData => {
|
|
|
- if(successData.errorCode == 0) {
|
|
|
- successData.data == null ? _self.assetConfigDto = {} : _self.assetConfigDto = successData.data;
|
|
|
+ if (successData.errorCode == 0) {
|
|
|
+ successData.data == null
|
|
|
+ ? (_self.assetConfigDto = {})
|
|
|
+ : (_self.assetConfigDto = successData.data);
|
|
|
} else {
|
|
|
- Notify.error('提示',successData.errorMessage, false);
|
|
|
+ Notify.error('提示', successData.errorMessage, false);
|
|
|
}
|
|
|
},
|
|
|
errorData => {
|
|
|
@@ -794,8 +796,8 @@ export default {
|
|
|
var _self = this;
|
|
|
AssetConfigResource.saveAssetConfig(_self.assetConfigDto).then(
|
|
|
successData => {
|
|
|
- if(successData.errorCode != 0) {
|
|
|
- Notify.error('提示','更新资产配置失败。', false);
|
|
|
+ if (successData.errorCode != 0) {
|
|
|
+ Notify.error('提示', '更新资产配置失败。', false);
|
|
|
return;
|
|
|
}
|
|
|
Notify.success('提示', '更新资产配置成功!', 1500);
|
|
|
@@ -828,20 +830,20 @@ export default {
|
|
|
*/
|
|
|
regenerateThumbnails: function () {
|
|
|
var _self = this;
|
|
|
- _self.loading=true;
|
|
|
+ _self.loading = true;
|
|
|
AssetConfigResource.regenerateThumbnails(_self.assetConfigDto).then(
|
|
|
successData => {
|
|
|
- if(successData.errorCode != 0) {
|
|
|
- Notify.error('提示','重新更新缩略图失败。', false);
|
|
|
- _self.loading=false;
|
|
|
+ if (successData.errorCode != 0) {
|
|
|
+ Notify.error('提示', '重新更新缩略图失败。', false);
|
|
|
+ _self.loading = false;
|
|
|
} else {
|
|
|
Notify.success('提示', '重新生成缩略图成功。', false);
|
|
|
- _self.loading=false;
|
|
|
+ _self.loading = false;
|
|
|
}
|
|
|
},
|
|
|
errorData => {
|
|
|
Common.processException(errorData);
|
|
|
- _self.loading=false;
|
|
|
+ _self.loading = false;
|
|
|
},
|
|
|
);
|
|
|
},
|
|
|
@@ -851,28 +853,62 @@ export default {
|
|
|
*/
|
|
|
generateAsset: function () {
|
|
|
var _self = this;
|
|
|
- _self.loading=true;
|
|
|
+ _self.loading = true;
|
|
|
AssetInstanceResource.generateAssetByAssetInstance().then(
|
|
|
successData => {
|
|
|
- if(successData.errorCode == 0) {
|
|
|
- Notify.success('提示', '共计生成' + successData.data + '个资产', false);
|
|
|
- _self.loading=false;
|
|
|
+ if (successData.errorCode == 0) {
|
|
|
+ Notify.success(
|
|
|
+ '提示',
|
|
|
+ '共计生成' + successData.data + '个资产',
|
|
|
+ false,
|
|
|
+ );
|
|
|
+ _self.loading = false;
|
|
|
} else {
|
|
|
- Notify.error('提示',successData.errorMessage, false);
|
|
|
- _self.loading=false;
|
|
|
+ Notify.error('提示', successData.errorMessage, false);
|
|
|
+ _self.loading = false;
|
|
|
}
|
|
|
},
|
|
|
errorData => {
|
|
|
Common.processException(errorData);
|
|
|
- _self.loading=false;
|
|
|
+ _self.loading = false;
|
|
|
},
|
|
|
);
|
|
|
},
|
|
|
|
|
|
+ // 初始化资产监控PostgreSQL时序数据库
|
|
|
+ initPostgreSQL: function () {
|
|
|
+ const params = {
|
|
|
+ params: null,
|
|
|
+ processNo: '20240307_185738',
|
|
|
+ resetEngine: false,
|
|
|
+ printJavaCode: false,
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ url: Common.getApiURL('ProcessResource/execute'),
|
|
|
+ type: 'post',
|
|
|
+ contentType: 'application/json',
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(params),
|
|
|
+ beforeSend: function (request) {
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
+ },
|
|
|
+
|
|
|
+ success: function (data) {
|
|
|
+ if (data.errorCode === 0) {
|
|
|
+ Notify.success('提示', '初始化资产监控PostgreSQL时序数据库成功!', 1500);
|
|
|
+ } else {
|
|
|
+ Notify.error(data.errorMessage);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
changeIsdisabled: function () {
|
|
|
this.isdisable = !this.isdisable;
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
getTotalNum: function (str) {
|
|
|
if (str == undefined || str == '') {
|
|
|
return;
|