@ -0,0 +1,17 @@ | |||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | |||||
# For additional information regarding the format and rule options, please see: | |||||
# https://github.com/browserslist/browserslist#queries | |||||
# For the full list of supported browsers by the Angular framework, please see: | |||||
# https://angular.io/guide/browser-support | |||||
# You can see what browsers were selected by your queries by running: | |||||
# npx browserslist | |||||
last 1 Chrome version | |||||
last 1 Firefox version | |||||
last 2 Edge major versions | |||||
last 2 Safari major versions | |||||
last 2 iOS major versions | |||||
Firefox ESR | |||||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. |
@ -0,0 +1,6 @@ | |||||
registry=https://registry.npm.taobao.org | |||||
unsafe-perm=true | |||||
@webdpt:registry=https://repo.digiwincloud.com.cn/maven/repository/npm-webdpt/ | |||||
@ng-dynamic-forms:registry=https://repo.digiwincloud.com.cn/maven/repository/npm-athena/ | |||||
node-options=--max-old-space-size=15000 |
@ -0,0 +1,120 @@ | |||||
{ | |||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |||||
"version": 1, | |||||
"newProjectRoot": "projects", | |||||
"projects": { | |||||
"@webdpt/athena-microsite": { | |||||
"projectType": "application", | |||||
"schematics": { | |||||
"@schematics/angular:component": { | |||||
"style": "less" | |||||
}, | |||||
"@schematics/angular:application": { | |||||
"strict": true | |||||
} | |||||
}, | |||||
"root": "", | |||||
"sourceRoot": "src", | |||||
"prefix": "app", | |||||
"architect": { | |||||
"build": { | |||||
"builder": "ngx-build-plus:browser", | |||||
"options": { | |||||
"outputPath": "dist/@webdpt/athena-microsite", | |||||
"index": { | |||||
"input": "src/index.html", | |||||
"output": "src/index.html" | |||||
}, | |||||
"main": "src/main.ts", | |||||
"polyfills": "src/polyfills.ts", | |||||
"tsConfig": "tsconfig.app.json", | |||||
"inlineStyleLanguage": "less", | |||||
"assets": [ | |||||
"src/favicon.ico", | |||||
"src/static" | |||||
], | |||||
"extraWebpackConfig": "webpack.config.js", | |||||
"commonChunk": false | |||||
}, | |||||
"configurations": { | |||||
"production": { | |||||
"budgets": [ | |||||
{ | |||||
"type": "initial", | |||||
"maximumWarning": "500kb", | |||||
"maximumError": "1mb" | |||||
}, | |||||
{ | |||||
"type": "anyComponentStyle", | |||||
"maximumWarning": "2kb", | |||||
"maximumError": "4kb" | |||||
} | |||||
], | |||||
"fileReplacements": [ | |||||
{ | |||||
"replace": "src/environments/environment.ts", | |||||
"with": "src/environments/environment.prod.ts" | |||||
} | |||||
], | |||||
"outputHashing": "all", | |||||
"extraWebpackConfig": "webpack.prod.config.js" | |||||
}, | |||||
"development": { | |||||
"buildOptimizer": false, | |||||
"optimization": false, | |||||
"vendorChunk": true, | |||||
"extractLicenses": false, | |||||
"sourceMap": true, | |||||
"namedChunks": true | |||||
} | |||||
}, | |||||
"defaultConfiguration": "production" | |||||
}, | |||||
"serve": { | |||||
"builder": "ngx-build-plus:dev-server", | |||||
"configurations": { | |||||
"production": { | |||||
"browserTarget": "@webdpt/athena-microsite:build:production", | |||||
"extraWebpackConfig": "webpack.prod.config.js" | |||||
}, | |||||
"development": { | |||||
"browserTarget": "@webdpt/athena-microsite:build:development" | |||||
} | |||||
}, | |||||
"defaultConfiguration": "development", | |||||
"options": { | |||||
"proxyConfig": "./proxy.conf.js", | |||||
"port": 4000, | |||||
"extraWebpackConfig": "webpack.config.js" | |||||
} | |||||
}, | |||||
"extract-i18n": { | |||||
"builder": "ngx-build-plus:extract-i18n", | |||||
"options": { | |||||
"browserTarget": "@webdpt/athena-microsite:build", | |||||
"extraWebpackConfig": "webpack.config.js" | |||||
} | |||||
}, | |||||
"test": { | |||||
"builder": "@angular-devkit/build-angular:karma", | |||||
"options": { | |||||
"main": "src/test.ts", | |||||
"polyfills": "src/polyfills.ts", | |||||
"tsConfig": "tsconfig.spec.json", | |||||
"karmaConfig": "karma.conf.js", | |||||
"inlineStyleLanguage": "less", | |||||
"assets": [ | |||||
"src/favicon.ico", | |||||
"src/assets" | |||||
], | |||||
"styles": [ | |||||
"src/styles.less" | |||||
], | |||||
"scripts": [] | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}, | |||||
"defaultProject": "@webdpt/athena-microsite" | |||||
} |
@ -0,0 +1,41 @@ | |||||
{ | |||||
"name": "athena-microsite", | |||||
"version": "1.0.0", | |||||
"scripts": { | |||||
"ng": "ng", | |||||
"start": "ng serve", | |||||
"build": "ng build", | |||||
"watch": "ng build --watch --configuration development", | |||||
"test": "ng test", | |||||
"run:all": "node node_modules/@angular-architects/module-federation/src/server/mf-dev-server.js" | |||||
}, | |||||
"private": true, | |||||
"dependencies": { | |||||
"@angular/animations": "12.2.16", | |||||
"@angular/common": "12.2.16", | |||||
"@angular/compiler": "12.2.16", | |||||
"@angular/core": "12.2.16", | |||||
"@angular/forms": "12.2.16", | |||||
"@angular/platform-browser": "12.2.16", | |||||
"@angular/platform-browser-dynamic": "12.2.16", | |||||
"@angular/router": "12.2.16", | |||||
"rxjs": "~6.6.0", | |||||
"tslib": "^2.3.0", | |||||
"zone.js": "~0.11.4" | |||||
}, | |||||
"devDependencies": { | |||||
"@angular-architects/module-federation": "^12.5.3", | |||||
"@angular-devkit/build-angular": "12.2.16", | |||||
"@angular/cli": "12.2.16", | |||||
"@angular/compiler-cli": "12.2.16", | |||||
"@types/jasmine": "~3.8.0", | |||||
"@types/node": "^12.11.1", | |||||
"jasmine-core": "~3.8.0", | |||||
"karma": "~6.3.0", | |||||
"karma-chrome-launcher": "~3.1.0", | |||||
"karma-coverage": "~2.0.3", | |||||
"karma-jasmine": "~4.0.0", | |||||
"karma-jasmine-html-reporter": "~1.7.0", | |||||
"typescript": "~4.3.5" | |||||
} | |||||
} |
@ -0,0 +1,62 @@ | |||||
const angularJson = require('./angular.json'); | |||||
const port = angularJson.projects['@webdpt/athena-microsite'].architect.serve.options.port; | |||||
const remotes = require('./src/static/remote-host.json'); | |||||
/** | |||||
* 拦截api.dev.json文件,将请求转发到本地,其他请求转发到线上 | |||||
*/ | |||||
const athena_web_url = remotes.host; | |||||
module.exports = { | |||||
"/assets/api.dev.json": { | |||||
"target": `http://localhost:${port}/static`, | |||||
"secure": false, | |||||
"pathRewrite": { | |||||
"^/assets": "" | |||||
}, | |||||
"changeOrigin": true | |||||
}, | |||||
"/static/package/plugins-config-server.json": { | |||||
"target": `http://localhost:${port}`, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/assets/*": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/static/package/*": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"pathRewrite": { | |||||
"^/static": "" | |||||
}, | |||||
"changeOrigin": true | |||||
}, | |||||
"/scripts/*": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/*.js": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/*.png": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/*.svg": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
}, | |||||
"/*.ttf": { | |||||
"target": athena_web_url, | |||||
"secure": false, | |||||
"changeOrigin": true | |||||
} | |||||
}; |
@ -0,0 +1,32 @@ | |||||
import { enableProdMode, Compiler, APP_INITIALIZER } from '@angular/core'; | |||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |||||
import { registerLocaleData } from '@angular/common'; | |||||
import zh from '@angular/common/locales/zh'; | |||||
import { environment } from './environments/environment'; | |||||
import { loadRemoteModule } from '@angular-architects/module-federation'; | |||||
// const remotes = require('./static/remote-host'); | |||||
import remoteHost from './static/remote-host.json'; | |||||
if (environment.production) { | |||||
enableProdMode(); | |||||
} | |||||
const configuration = { | |||||
remoteEntry: remoteHost.host + '/athenaAppModule.js?t=' + new Date().getTime(), | |||||
remoteName: 'profile', | |||||
exposedModule: 'ProfileModule', | |||||
moduleName: 'AppModule', | |||||
componentName: 'AppComponent', | |||||
}; | |||||
const { remoteEntry, remoteName, exposedModule, moduleName, componentName } = configuration; | |||||
loadRemoteModule({ remoteEntry, remoteName, exposedModule }).then((m) => { | |||||
const appModule = m[moduleName]; | |||||
registerLocaleData(zh); | |||||
platformBrowserDynamic().bootstrapModule(appModule).then(() => { | |||||
}) | |||||
.catch(err => console.error(err)); | |||||
}); | |||||
@ -0,0 +1,3 @@ | |||||
export const environment = { | |||||
production: true | |||||
}; |
@ -0,0 +1,16 @@ | |||||
// This file can be replaced during build by using the `fileReplacements` array. | |||||
// `ng build` replaces `environment.ts` with `environment.prod.ts`. | |||||
// The list of file replacements can be found in `angular.json`. | |||||
export const environment = { | |||||
production: false | |||||
}; | |||||
/* | |||||
* For easier debugging in development mode, you can import the following file | |||||
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. | |||||
* | |||||
* This import should be commented out in production mode because it will have a negative impact | |||||
* on performance if an error is thrown. | |||||
*/ | |||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. |
@ -0,0 +1,15 @@ | |||||
<!doctype html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<title>鼎捷雅典娜</title> | |||||
<base href="/"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | |||||
<link rel="stylesheet" href="https://athena-test.digiwincloud.com.cn/styles.css"> | |||||
</head> | |||||
<body class="ath-default-theme"> | |||||
<app-root></app-root> | |||||
<script src="https://athena-test.digiwincloud.com.cn/scripts.js" defer></script> | |||||
</body> | |||||
</html> |
@ -0,0 +1,2 @@ | |||||
import('./bootstrap') | |||||
.catch(err => console.error(err)); |
@ -0,0 +1,66 @@ | |||||
/** | |||||
* This file includes polyfills needed by Angular and is loaded before the app. | |||||
* You can add your own extra polyfills to this file. | |||||
* | |||||
* This file is divided into 2 sections: | |||||
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. | |||||
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main | |||||
* file. | |||||
* | |||||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that | |||||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), | |||||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. | |||||
* | |||||
* Learn more in https://angular.io/guide/browser-support | |||||
*/ | |||||
/*************************************************************************************************** | |||||
* BROWSER POLYFILLS | |||||
*/ | |||||
/** | |||||
* IE11 requires the following for NgClass support on SVG elements | |||||
*/ | |||||
// import 'classlist.js'; // Run `npm install --save classlist.js`. | |||||
/** | |||||
* Web Animations `@angular/platform-browser/animations` | |||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. | |||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). | |||||
*/ | |||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. | |||||
/** | |||||
* By default, zone.js will patch all possible macroTask and DomEvents | |||||
* user can disable parts of macroTask/DomEvents patch by setting following flags | |||||
* because those flags need to be set before `zone.js` being loaded, and webpack | |||||
* will put import in the top of bundle, so user need to create a separate file | |||||
* in this directory (for example: zone-flags.ts), and put the following flags | |||||
* into that file, and then add the following code before importing zone.js. | |||||
* import './zone-flags'; | |||||
* | |||||
* The flags allowed in zone-flags.ts are listed here. | |||||
* | |||||
* The following flags will work for all browsers. | |||||
* | |||||
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame | |||||
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick | |||||
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames | |||||
* | |||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js | |||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge | |||||
* | |||||
* (window as any).__Zone_enable_cross_context_check = true; | |||||
* | |||||
*/ | |||||
/*************************************************************************************************** | |||||
* Zone JS is required by default for Angular itself. | |||||
*/ | |||||
import 'zone.js'; // Included with Angular CLI. | |||||
/*************************************************************************************************** | |||||
* APPLICATION IMPORTS | |||||
*/ | |||||
import 'reflect-metadata'; |
@ -0,0 +1 @@ | |||||
1736933834241 |
@ -0,0 +1,108 @@ | |||||
{ | |||||
"apiUrl": "https://semcdwscreen-test.apps.digiwincloud.com.cn", | |||||
"iamUrl": "https://iam-test.digiwincloud.com.cn", | |||||
"bossIamUrl": "https://bossiam-test.digiwincloud.com.cn", | |||||
"emcUrl": "https://emc-test.digiwincloud.com.cn", | |||||
"mscUrl": "https://msc-test.digiwincloud.com.cn", | |||||
"eocUrl": "https://eoc-test.digiwincloud.com.cn", | |||||
"dmcUrl": "https://dmc-hw-test.digiwincloud.com.cn", | |||||
"cacUrl": "https://cac-test.digiwincloud.com.cn", | |||||
"themeMapUrl": "https://knowledgemaps-test.apps.digiwincloud.com.cn/restful/service", | |||||
"knowledgeMapsUrl": "https://knowledgemaps-test.apps.digiwincloud.com.cn/restful/service", | |||||
"knowledgegraphUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/knowledgegraph", | |||||
"datamapUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/datamap", | |||||
"smartDataUrl": "https://smartdata-test.apps.digiwincloud.com.cn/restful/service", | |||||
"agileInteractionUrl": "https://agileinteraction-test.apps.digiwincloud.com.cn", | |||||
"uibotUrl": "https://uibot-test.apps.digiwincloud.com.cn", | |||||
"atmcUrl": "https://atmc-test.apps.digiwincloud.com.cn", | |||||
"atdmUrl": "https://atdm-test.apps.digiwincloud.com.cn", | |||||
"multiTenant": "true", | |||||
"athenaConsole": "https://athena-console-test.digiwincloud.com.cn", | |||||
"consoleUrl": "https://console-test.digiwincloud.com.cn", | |||||
"muiUrl": "https://athena-test.digiwincloud.com.cn", | |||||
"bpmUrl": "https://flowengine-test.apps.digiwincloud.com.cn/restful/standard/bpm_cloud", | |||||
"digiwincloudUrl": "https://market-test.digiwincloud.com.cn", | |||||
"aimUrl": "https://aim-test.apps.digiwincloud.com.cn", | |||||
"aamUrl": "https://aam-test.apps.digiwincloud.com.cn", | |||||
"designerUrl": "https://athena-designer-test.digiwincloud.com.cn", | |||||
"tddUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/deliverydesigner", | |||||
"deliverydesignerUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/deliverydesigner", | |||||
"imUrl": "https://im-test.apps.digiwincloud.com.cn", | |||||
"imAppKey": "8233e04f875b85cfbad5ef2e60ce35e4", | |||||
"pluginUrl": "http://localhost:4000/static/package", | |||||
"tbbUrl": "https://tbb.apps.digiwincloud.com.cn:2448", | |||||
"biUrl": "https://digiwinabi-test.apps.digiwincloud.com.cn", | |||||
"alearningUrl": "https://alearning-test.apps.digiwincloud.com.cn", | |||||
"customerServiceUrl": "https://es-s-test.digiwincloud.com.cn:30014", | |||||
"customerServiceRegion": "CN", | |||||
"taskEngineUrl": "https://taskengine-test.apps.digiwincloud.com.cn/restful/standard/taskengine", | |||||
"audcUrl": "https://audc-test.apps.digiwincloud.com.cn", | |||||
"userBehaviorUploadInterval": "1", | |||||
"userBehaviorMaxUploadCount": "50", | |||||
"userBehaviorCheckCountInterval": "2", | |||||
"nlpImUrl": "https://nlpim-test.apps.digiwincloud.com.cn", | |||||
"nlpBotUrl": "https://webot-kf.digiwincloud.com.cn", | |||||
"prodFutureFeature": "false", | |||||
"isFormalArea": "false", | |||||
"enableArms": "false", | |||||
"armsPid": "guxvxe3gog@2c4e3159c076827", | |||||
"itUrl": "https://athena-it-test.digiwincloud.com.cn", | |||||
"ocrApiUrl": "https://bai-cloudeia.digiwin.com:8088", | |||||
"enableMqtt": "true", | |||||
"mqttUrl": "wss://emqx-athena-test.digiwincloud.com.cn", | |||||
"mqttPort": "8084", | |||||
"mqttPath": "/mqtt", | |||||
"mqttUserName": "", | |||||
"mqttPassword": "", | |||||
"serverName": "TEST", | |||||
"mdcUrl": "https://mdc-test.apps.digiwincloud.com.cn", | |||||
"lmcUrl": "https://lmc-test.digiwincloud.com.cn", | |||||
"ddsmDesignerUrl": "https://eas-designer-test.digiwincloud.com.cn", | |||||
"espUrl": "https://esp-test.apps.digiwincloud.com.cn", | |||||
"qianyeTenantId": "72007522,72007522_001", | |||||
"imSwitch": "", | |||||
"customerServiceSwitch": "", | |||||
"nlpSwitch": "false", | |||||
"ganttChartServiceUrl": "https://ganttchart-test.apps.digiwincloud.com.cn", | |||||
"apaTKUrl": "https://apa-tk-test.apps.digiwincloud.com.cn", | |||||
"caLqsUrl": "https://ca-lqs-athenaopt-test.apps.digiwincloud.com.cn", | |||||
"semcUrl": "https://semc-test.apps.digiwincloud.com.cn", | |||||
"semcEnter": "true", | |||||
"semcWebUrl": "https://semc-test.digiwincloud.com.cn", | |||||
"experienceUrl": "https://experience-test.apps.digiwincloud.com.cn", | |||||
"camUrl": "https://cam-test.digiwincloud.com.cn", | |||||
"entranceUrl": "https://athena-entrance-test.digiwincloud.com.cn", | |||||
"shangqiUrl": "https://ilinkfuture.saicmotortest.com/framework/library.js", | |||||
"troubleshootUrl": "https://troubleshoot-test.apps.digiwincloud.com.cn", | |||||
"abiToGrapecityReportList": "", | |||||
"abiToGrapecityUrl": "", | |||||
"abiToGrapecityToken": "", | |||||
"chatFileUrl": "https://kcf-test.apps.digiwincloud.com.cn", | |||||
"translateUrl": "https://translation-paas.apps.digiwincloud.com.cn", | |||||
"imSDKType": "nim", | |||||
"ptmUrl": "https://taskengine-test.apps.digiwincloud.com.cn/restful/standard/ptm", | |||||
"gptUrl": "https://kafka-middle-test.apps.digiwincloud.com.cn", | |||||
"adtUrl": "https://adt-test.apps.digiwincloud.com.cn", | |||||
"adeUrl": "https://agiledataengine-test.apps.digiwincloud.com.cn", | |||||
"echoUrl": "https://agiledataecho-test.apps.digiwincloud.com.cn", | |||||
"nanaUrl": "https://ania-web-test.digiwincloud.com.cn", | |||||
"nanaUser": "test_cnhw_4931", | |||||
"agoraUser": "", | |||||
"nanaEnv": "ania_hw_test", | |||||
"asaUrl": "https://asa-test.apps.digiwincloud.com.cn", | |||||
"aniaAppsUrl": "https://ania-test.apps.digiwincloud.com.cn", | |||||
"mqttServiceName": "ASA_TEST", | |||||
"mqttTenantId": "asatest", | |||||
"cpmUrl": "https://tbb.apps.digiwincloud.com.cn:3010", | |||||
"kmoUrl": "https://kmo-test.apps.digiwincloud.com.cn", | |||||
"distributedApplications": "", | |||||
"reportDesignVideo": "", | |||||
"onlyLoadAppModules": "true", | |||||
"versionChange": "", | |||||
"kbsUrl": "https://kbs-test.apps.digiwincloud.com.cn", | |||||
"digiwinSpecTenant": "141515", | |||||
"bgShowKey": "", | |||||
"dmcPublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq7CIjfdOxx/HcMm4pv37q8Cc43+FwNVTXtYZbDbAk31BfVLnQ4qfal0NboRH5qlDH0Iv7QsjmhKNPZLidhM2Ffy4EUgCW5nGFU0SIsClCXBUBUU6Ud520zjkyZZkP7oImUtsI3rVwCp9yOCgN85IXu+IqX3xpEUqd2YKQ9/yXC9zxO+j2ksDUXXhUF54eFHncdwgE/il874XZCrfOjEZ6ovW1oIsfCcNvBJxgG01eBevCQF88sw2amAyb3oV6GIwMG4FxVSBXBX4cQ/ejqS680GKLYgTCZ89/mIzqtoFa7f0oXFSZ5MKoNtZbfh7QAKFF3i9Wj51urLQ96MjlDuV2wIDAQAB", | |||||
"bffEvscotrUrl": "https://bff-evscotr-test.apps.digiwincloud.com.cn", | |||||
"abtUrl": "https://abt-test.apps.digiwincloud.com.cn" | |||||
} |
@ -0,0 +1,108 @@ | |||||
{ | |||||
"apiUrl": "https://semcdwscreen-test.apps.digiwincloud.com.cn", | |||||
"iamUrl": "https://iam-test.digiwincloud.com.cn", | |||||
"bossIamUrl": "https://bossiam-test.digiwincloud.com.cn", | |||||
"emcUrl": "https://emc-test.digiwincloud.com.cn", | |||||
"mscUrl": "https://msc-test.digiwincloud.com.cn", | |||||
"eocUrl": "https://eoc-test.digiwincloud.com.cn", | |||||
"dmcUrl": "https://dmc-hw-test.digiwincloud.com.cn", | |||||
"cacUrl": "https://cac-test.digiwincloud.com.cn", | |||||
"themeMapUrl": "https://knowledgemaps-test.apps.digiwincloud.com.cn/restful/service", | |||||
"knowledgeMapsUrl": "https://knowledgemaps-test.apps.digiwincloud.com.cn/restful/service", | |||||
"knowledgegraphUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/knowledgegraph", | |||||
"datamapUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/datamap", | |||||
"smartDataUrl": "https://smartdata-test.apps.digiwincloud.com.cn/restful/service", | |||||
"agileInteractionUrl": "https://agileinteraction-test.apps.digiwincloud.com.cn", | |||||
"uibotUrl": "https://uibot-test.apps.digiwincloud.com.cn", | |||||
"atmcUrl": "https://atmc-test.apps.digiwincloud.com.cn", | |||||
"atdmUrl": "https://atdm-test.apps.digiwincloud.com.cn", | |||||
"multiTenant": "true", | |||||
"athenaConsole": "https://athena-console-test.digiwincloud.com.cn", | |||||
"consoleUrl": "https://console-test.digiwincloud.com.cn", | |||||
"muiUrl": "https://athena-test.digiwincloud.com.cn", | |||||
"bpmUrl": "https://flowengine-test.apps.digiwincloud.com.cn/restful/standard/bpm_cloud", | |||||
"digiwincloudUrl": "https://market-test.digiwincloud.com.cn", | |||||
"aimUrl": "https://aim-test.apps.digiwincloud.com.cn", | |||||
"aamUrl": "https://aam-test.apps.digiwincloud.com.cn", | |||||
"designerUrl": "https://athena-designer-test.digiwincloud.com.cn", | |||||
"tddUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/deliverydesigner", | |||||
"deliverydesignerUrl": "https://isv-gateway-test.apps.digiwincloud.com.cn/deliverydesigner", | |||||
"imUrl": "https://im-test.apps.digiwincloud.com.cn", | |||||
"imAppKey": "8233e04f875b85cfbad5ef2e60ce35e4", | |||||
"pluginUrl": "https://athena-test.digiwincloud.com.cn/package", | |||||
"tbbUrl": "https://tbb.apps.digiwincloud.com.cn:2448", | |||||
"biUrl": "https://digiwinabi-test.apps.digiwincloud.com.cn", | |||||
"alearningUrl": "https://alearning-test.apps.digiwincloud.com.cn", | |||||
"customerServiceUrl": "https://es-s-test.digiwincloud.com.cn:30014", | |||||
"customerServiceRegion": "CN", | |||||
"taskEngineUrl": "https://taskengine-test.apps.digiwincloud.com.cn/restful/standard/taskengine", | |||||
"audcUrl": "https://audc-test.apps.digiwincloud.com.cn", | |||||
"userBehaviorUploadInterval": "1", | |||||
"userBehaviorMaxUploadCount": "50", | |||||
"userBehaviorCheckCountInterval": "2", | |||||
"nlpImUrl": "https://nlpim-test.apps.digiwincloud.com.cn", | |||||
"nlpBotUrl": "https://webot-kf.digiwincloud.com.cn", | |||||
"prodFutureFeature": "false", | |||||
"isFormalArea": "false", | |||||
"enableArms": "false", | |||||
"armsPid": "guxvxe3gog@2c4e3159c076827", | |||||
"itUrl": "https://athena-it-test.digiwincloud.com.cn", | |||||
"ocrApiUrl": "https://bai-cloudeia.digiwin.com:8088", | |||||
"enableMqtt": "true", | |||||
"mqttUrl": "wss://emqx-athena-test.digiwincloud.com.cn", | |||||
"mqttPort": "8084", | |||||
"mqttPath": "/mqtt", | |||||
"mqttUserName": "", | |||||
"mqttPassword": "", | |||||
"serverName": "TEST", | |||||
"mdcUrl": "https://mdc-test.apps.digiwincloud.com.cn", | |||||
"lmcUrl": "https://lmc-test.digiwincloud.com.cn", | |||||
"ddsmDesignerUrl": "https://eas-designer-test.digiwincloud.com.cn", | |||||
"espUrl": "https://esp-test.apps.digiwincloud.com.cn", | |||||
"qianyeTenantId": "72007522,72007522_001", | |||||
"imSwitch": "", | |||||
"customerServiceSwitch": "", | |||||
"nlpSwitch": "false", | |||||
"ganttChartServiceUrl": "https://ganttchart-test.apps.digiwincloud.com.cn", | |||||
"apaTKUrl": "https://apa-tk-test.apps.digiwincloud.com.cn", | |||||
"caLqsUrl": "https://ca-lqs-athenaopt-test.apps.digiwincloud.com.cn", | |||||
"semcUrl": "https://semc-test.apps.digiwincloud.com.cn", | |||||
"semcEnter": "true", | |||||
"semcWebUrl": "https://semc-test.digiwincloud.com.cn", | |||||
"experienceUrl": "https://experience-test.apps.digiwincloud.com.cn", | |||||
"camUrl": "https://cam-test.digiwincloud.com.cn", | |||||
"entranceUrl": "https://athena-entrance-test.digiwincloud.com.cn", | |||||
"shangqiUrl": "https://ilinkfuture.saicmotortest.com/framework/library.js", | |||||
"troubleshootUrl": "https://troubleshoot-test.apps.digiwincloud.com.cn", | |||||
"abiToGrapecityReportList": "", | |||||
"abiToGrapecityUrl": "", | |||||
"abiToGrapecityToken": "", | |||||
"chatFileUrl": "https://kcf-test.apps.digiwincloud.com.cn", | |||||
"translateUrl": "https://translation-paas.apps.digiwincloud.com.cn", | |||||
"imSDKType": "nim", | |||||
"ptmUrl": "https://taskengine-test.apps.digiwincloud.com.cn/restful/standard/ptm", | |||||
"gptUrl": "https://kafka-middle-test.apps.digiwincloud.com.cn", | |||||
"adtUrl": "https://adt-test.apps.digiwincloud.com.cn", | |||||
"adeUrl": "https://agiledataengine-test.apps.digiwincloud.com.cn", | |||||
"echoUrl": "https://agiledataecho-test.apps.digiwincloud.com.cn", | |||||
"nanaUrl": "https://ania-web-test.digiwincloud.com.cn", | |||||
"nanaUser": "test_cnhw_4931", | |||||
"agoraUser": "", | |||||
"nanaEnv": "ania_hw_test", | |||||
"asaUrl": "https://asa-test.apps.digiwincloud.com.cn", | |||||
"aniaAppsUrl": "https://ania-test.apps.digiwincloud.com.cn", | |||||
"mqttServiceName": "ASA_TEST", | |||||
"mqttTenantId": "asatest", | |||||
"cpmUrl": "https://tbb.apps.digiwincloud.com.cn:3010", | |||||
"kmoUrl": "https://kmo-test.apps.digiwincloud.com.cn", | |||||
"distributedApplications": "", | |||||
"reportDesignVideo": "", | |||||
"onlyLoadAppModules": "true", | |||||
"versionChange": "", | |||||
"kbsUrl": "https://kbs-test.apps.digiwincloud.com.cn", | |||||
"digiwinSpecTenant": "141515", | |||||
"bgShowKey": "", | |||||
"dmcPublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq7CIjfdOxx/HcMm4pv37q8Cc43+FwNVTXtYZbDbAk31BfVLnQ4qfal0NboRH5qlDH0Iv7QsjmhKNPZLidhM2Ffy4EUgCW5nGFU0SIsClCXBUBUU6Ud520zjkyZZkP7oImUtsI3rVwCp9yOCgN85IXu+IqX3xpEUqd2YKQ9/yXC9zxO+j2ksDUXXhUF54eFHncdwgE/il874XZCrfOjEZ6ovW1oIsfCcNvBJxgG01eBevCQF88sw2amAyb3oV6GIwMG4FxVSBXBX4cQ/ejqS680GKLYgTCZ89/mIzqtoFa7f0oXFSZ5MKoNtZbfh7QAKFF3i9Wj51urLQ96MjlDuV2wIDAQAB", | |||||
"bffEvscotrUrl": "https://bff-evscotr-test.apps.digiwincloud.com.cn", | |||||
"abtUrl": "https://abt-test.apps.digiwincloud.com.cn" | |||||
} |
@ -0,0 +1 @@ | |||||
{} |
@ -0,0 +1,16 @@ | |||||
{ | |||||
"app": { | |||||
"efm-demoAT": { | |||||
"name": "efm-demoAT", | |||||
"urlPrefixType": "", | |||||
"root": "http://localhost:4200", | |||||
"path": "EfmDemoATModule.js", | |||||
"description": "", | |||||
"i18n": true, | |||||
"disabledMultiVersion": true, | |||||
"isMF": true, | |||||
"moduleName": "EfmDemoATModule", | |||||
"exposesPath": "./efm-demoAT" | |||||
} | |||||
} | |||||
} |
@ -0,0 +1 @@ | |||||
{"host":"https://athena-test.digiwincloud.com.cn"} |
@ -0,0 +1,4 @@ | |||||
/* You can add global styles to this file, and also import other style files */ | |||||
body{ | |||||
background-color: #f5f5f5; | |||||
} |
@ -0,0 +1,27 @@ | |||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files | |||||
import 'zone.js/testing'; | |||||
import { getTestBed } from '@angular/core/testing'; | |||||
import { | |||||
BrowserDynamicTestingModule, | |||||
platformBrowserDynamicTesting | |||||
} from '@angular/platform-browser-dynamic/testing'; | |||||
declare const require: { | |||||
context(path: string, deep?: boolean, filter?: RegExp): { | |||||
keys(): string[]; | |||||
<T>(id: string): T; | |||||
}; | |||||
}; | |||||
// First, initialize the Angular testing environment. | |||||
getTestBed().initTestEnvironment( | |||||
BrowserDynamicTestingModule, | |||||
platformBrowserDynamicTesting(), | |||||
{ teardown: { destroyAfterEach: true }}, | |||||
); | |||||
// Then we find all the tests. | |||||
const context = require.context('./', true, /\.spec\.ts$/); | |||||
// And load the modules. | |||||
context.keys().forEach(context); |
@ -0,0 +1,15 @@ | |||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | |||||
{ | |||||
"extends": "./tsconfig.json", | |||||
"compilerOptions": { | |||||
"outDir": "./out-tsc/app", | |||||
"types": [] | |||||
}, | |||||
"files": [ | |||||
"src/main.ts", | |||||
"src/polyfills.ts" | |||||
], | |||||
"include": [ | |||||
"src/**/*.d.ts" | |||||
] | |||||
} |
@ -0,0 +1,36 @@ | |||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | |||||
{ | |||||
"compileOnSave": false, | |||||
"compilerOptions": { | |||||
"baseUrl": "./", | |||||
"outDir": "./dist/out-tsc", | |||||
"forceConsistentCasingInFileNames": true, | |||||
"strict": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"sourceMap": true, | |||||
"declaration": false, | |||||
"downlevelIteration": true, | |||||
"experimentalDecorators": true, | |||||
"emitDecoratorMetadata": true, | |||||
"moduleResolution": "node", | |||||
"importHelpers": true, | |||||
"resolveJsonModule": true, | |||||
"allowSyntheticDefaultImports": true, | |||||
"target": "es6", | |||||
"module": "es2020", | |||||
"lib": [ | |||||
"es2018", | |||||
"dom" | |||||
] | |||||
}, | |||||
"include": [ | |||||
"./src/**/*.ts" | |||||
, "src/static/remote-host.json" ], | |||||
"angularCompilerOptions": { | |||||
"enableI18nLegacyMessageIdFormat": false, | |||||
"strictInjectionParameters": true, | |||||
"strictInputAccessModifiers": true, | |||||
"strictTemplates": true | |||||
} | |||||
} |
@ -0,0 +1,40 @@ | |||||
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); | |||||
const mf = require("@angular-architects/module-federation/webpack"); | |||||
const path = require("path"); | |||||
const share = mf.share; | |||||
const sharedMappings = new mf.SharedMappings(); | |||||
sharedMappings.register( | |||||
path.join(__dirname, 'tsconfig.json'), | |||||
[/* mapped paths to share */]); | |||||
module.exports = { | |||||
output: { | |||||
uniqueName: "athena_microsite", | |||||
publicPath: "auto" | |||||
}, | |||||
optimization: { | |||||
runtimeChunk: false, | |||||
splitChunks: false | |||||
}, | |||||
resolve: { | |||||
alias: { | |||||
...sharedMappings.getAliases(), | |||||
} | |||||
}, | |||||
plugins: [ | |||||
new ModuleFederationPlugin({ | |||||
shared: share({ | |||||
"@angular/core": { singleton: true, strictVersion: true, requiredVersion: 'auto' }, | |||||
"@angular/common": { singleton: true, strictVersion: true, requiredVersion: 'auto' }, | |||||
"@angular/common/http": { singleton: true, strictVersion: true, requiredVersion: 'auto' }, | |||||
"@angular/router": { singleton: true, strictVersion: true, requiredVersion: 'auto' }, | |||||
...sharedMappings.getDescriptors() | |||||
}) | |||||
}), | |||||
sharedMappings.getPlugin() | |||||
], | |||||
}; |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL = 'device-detail'; | |||||
export class DynamicDeviceDetailModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST = 'dispatch-list'; | |||||
export class DynamicDispatchListModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT = 'fault-count'; | |||||
export class DynamicFaultCountModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,33 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN = 'fault-detail-btn'; | |||||
export class DynamicFaultDetailBtnModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = | |||||
DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,33 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW = 'fault_plan_add_row'; | |||||
export class DynamicFaultPlanAddRowModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = | |||||
DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED = 'operate_filed'; | |||||
export class DynamicFaultPlanOperateFiledModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE = 'knowledge-base'; | |||||
export class DynamicKnowledgeBaseModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN = 'product-plan'; | |||||
export class DynamicProductPlanModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_SETTING_BTN = 'setting-btn'; | |||||
export class DynamicSettingBtnModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_SETTING_BTN; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,32 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND = 'time-expand'; | |||||
export class DynamicTimeExpandModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -0,0 +1,33 @@ | |||||
import { | |||||
DynamicFormValueControlModelConfig, | |||||
DynamicFormValueControlModel, | |||||
serializable, | |||||
DynamicFormControlLayout, | |||||
} from '@athena/dynamic-core'; | |||||
import { DefaultModelConfig, StateCode } from '../model'; | |||||
export const DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT = 'work_order_effect'; | |||||
export class DynamicWorkOrderEffectModel extends DynamicFormValueControlModel<any> { | |||||
@serializable() readonly type: string = | |||||
DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT; | |||||
@serializable() stateCode?: StateCode; | |||||
@serializable() actions?: any[]; | |||||
@serializable() operations?: any[]; | |||||
@serializable() finished?: boolean; | |||||
@serializable() extendedFields: any; | |||||
@serializable() attach: any; | |||||
@serializable() config: any; | |||||
constructor(config: DefaultModelConfig, layout?: DynamicFormControlLayout) { | |||||
super(config, layout); | |||||
this.type = config?.type; | |||||
this.stateCode = config?.stateCode; | |||||
this.actions = config?.actions ?? []; | |||||
this.operations = config?.operations ?? []; | |||||
this.finished = config?.finished ?? false; | |||||
this.extendedFields = config?.extendedFields ?? null; | |||||
this.attach = config?.attach ?? null; | |||||
this.config = config; | |||||
} | |||||
} |
@ -1,10 +1,12 @@ | |||||
import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||
import { CommonModule } from '@angular/common'; | import { CommonModule } from '@angular/common'; | ||||
import { FaultPlanAddRowModule } from './fault-plan-add-row/fault-plan-add-row.module'; | |||||
import { FaultPlanOperateFiledModule } from './fault-plan-operate-filed/fault-plan-operate-filed.module'; | |||||
const programsModules = []; | |||||
const programsModules = [FaultPlanAddRowModule, FaultPlanOperateFiledModule]; | |||||
@NgModule({ | @NgModule({ | ||||
imports: [CommonModule, ...programsModules], | imports: [CommonModule, ...programsModules], | ||||
declarations: [], | declarations: [], | ||||
}) | }) | ||||
export class BasicDetailModule {} | |||||
export class BasicDetailModule { } |
@ -0,0 +1,3 @@ | |||||
<div class="fault-plan-add-row"> | |||||
<button ath-toolbar-button (click)="addRow()">新增</button> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.fault-plan-add-row{ | |||||
} |
@ -0,0 +1,87 @@ | |||||
/* eslint-disable indent */ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicFaultPlanAddRowModel } from 'app/implementation/model/fault-plan-add-row/fault-plan-add-row.model'; | |||||
import { FaultPlanAddRowService } from './fault-plan-add-row.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
@Component({ | |||||
selector: 'app-fault-plan-add-row', | |||||
templateUrl: './fault-plan-add-row.component.html', | |||||
styleUrls: ['./fault-plan-add-row.component.less'], | |||||
providers: [FaultPlanAddRowService, CommonService], | |||||
}) | |||||
export class FaultPlanAddRowComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicFaultPlanAddRowModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private faultPlanAddRowService: FaultPlanAddRowService, | |||||
public commonService: CommonService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
console.log('group', this.group); | |||||
} | |||||
get tableList(): any { | |||||
return this.group.get('fault_plan_info_basic_details')['_component']; | |||||
} | |||||
addRow() { | |||||
// 找到当前表格内最大的序号 | |||||
const maxSeq = this.group.get('fault_plan_info_basic_details').value.length | |||||
? Math.max( | |||||
...(this.group.get('fault_plan_info_basic_details').value as any).map( | |||||
(control) => { | |||||
return control.sequence; | |||||
} | |||||
) | |||||
) | |||||
: 0; | |||||
const addData = Object.assign( | |||||
{}, | |||||
{ sequence: maxSeq + 1, operation: '', value: '', waiting_time: '' } | |||||
); | |||||
this.tableList.addRow( | |||||
addData, | |||||
false, | |||||
this.tableList, | |||||
false, | |||||
this.tableList.length | |||||
); | |||||
console.log('groupadd2', this.group); | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { FaultPlanAddRowComponent } from './fault-plan-add-row.component'; | |||||
@NgModule({ | |||||
declarations: [ FaultPlanAddRowComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class FaultPlanAddRowModule {} |
@ -0,0 +1,50 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class FaultPlanAddRowService{ | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,5 @@ | |||||
<div class="fault-plan-operate-filed"> | |||||
<span class="opreate-btn" (click)="upRow()">上移</span> | |||||
<span class="opreate-btn" (click)="downRow()">下移</span> | |||||
<span class="opreate-btn" (click)="removeRow()">删除</span> | |||||
</div> |
@ -0,0 +1,7 @@ | |||||
.fault-plan-operate-filed { | |||||
.opreate-btn { | |||||
color: blue; | |||||
padding-right: 10px; | |||||
cursor: pointer; | |||||
} | |||||
} |
@ -0,0 +1,231 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DwFormArray, | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicFaultPlanOperateFiledModel } from 'app/implementation/model/fault-plan-operate-filed/fault-plan-operate-filed.model'; | |||||
import { FaultPlanOperateFiledService } from './fault-plan-operate-filed.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
@Component({ | |||||
selector: 'app-fault-plan-operate-filed', | |||||
templateUrl: './fault-plan-operate-filed.component.html', | |||||
styleUrls: ['./fault-plan-operate-filed.component.less'], | |||||
providers: [FaultPlanOperateFiledService, CommonService], | |||||
}) | |||||
export class FaultPlanOperateFiledComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicFaultPlanOperateFiledModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private faultPlanOperateFiledService: FaultPlanOperateFiledService, | |||||
public commonService: CommonService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
console.log('group', this.group.get('')); | |||||
} | |||||
// get disableButton(): boolean { | |||||
// return this.group.parent.parent.get('review_status').value === 2; | |||||
// } | |||||
get tableList(): any { | |||||
return this.group.parent.parent.get('fault_plan_info_basic_details')[ | |||||
'_component' | |||||
]; | |||||
} | |||||
removeRow() { | |||||
/** 表格内操作栏位新增删除定制按钮,点击删除,删除时将该行删除,然后把第一个页签的内容全覆盖至第二个页签,( | |||||
* 若为最后一行则直接删除) | |||||
* */ | |||||
// 若为最后一行则直接删除 | |||||
if (this.group.get('sequence').value === this.group.parent.value.length) { | |||||
const lastIndex = | |||||
this.group.parent.parent.get('fault_plan_info_basic_details').value | |||||
.length - 1; | |||||
this.tableList.removeRow( | |||||
( | |||||
( | |||||
this.group.parent.parent.get( | |||||
'fault_plan_info_basic_details' | |||||
) as DwFormArray | |||||
).at(lastIndex) as any | |||||
).uuid | |||||
); | |||||
this.changeRef.markForCheck(); | |||||
this.changeRef.detectChanges(); | |||||
} else { | |||||
// 删除时将该行删除,删除第二个页签内相同序号的行,将大于该序号的行的序号+1 | |||||
// 根据index找uuid | |||||
const deleteIndex = this.group.parent.parent | |||||
.get('fault_plan_info_basic_details') | |||||
.value.findIndex( | |||||
(product) => product.sequence === this.group.get('sequence').value | |||||
); | |||||
// eslint-disable-next-line no-unused-expressions | |||||
this.tableList.removeRow( | |||||
( | |||||
( | |||||
this.group.parent.parent.get( | |||||
'fault_plan_info_basic_details' | |||||
) as DwFormArray | |||||
).at(deleteIndex) as any | |||||
).uuid | |||||
); | |||||
// 且大于该行序号的行序号将进行重新排序,第一第二个页签都需要 | |||||
( | |||||
this.group.parent.parent.get( | |||||
'fault_plan_info_basic_details' | |||||
) as DwFormArray | |||||
).controls.forEach((control) => { | |||||
const order_seq = control.get('sequence').value; | |||||
if (order_seq > deleteIndex) { | |||||
control.get('sequence').patchValue(order_seq - 1); | |||||
} | |||||
}); | |||||
} | |||||
// 标准无法实现,补充逻辑: | |||||
// this.tableList.removeRow(this.group.parent.parent.value.uuid); | |||||
} | |||||
upRow() { | |||||
const upIndex = this.group.parent.parent | |||||
.get('fault_plan_info_basic_details') | |||||
.value.findIndex( | |||||
(product) => product.sequence === this.group.get('sequence').value | |||||
); | |||||
if (upIndex !== 0) { | |||||
console.log('tableList', this.tableList); | |||||
const currentValue = this.tableList['control']['controls'][upIndex].value; | |||||
const preValue = this.tableList['control']['controls'][upIndex - 1].value; | |||||
const tableList = ( | |||||
this.group.parent.parent.get( | |||||
'fault_plan_info_basic_details' | |||||
) as DwFormArray | |||||
).controls; | |||||
tableList[upIndex].patchValue({ | |||||
create_by: preValue.create_by, | |||||
create_date: preValue.create_date, | |||||
creator_name: preValue.creator_name, | |||||
fault_plan_info_basic_details_id: | |||||
preValue.fault_plan_info_basic_details_id, | |||||
fault_plan_info_id: preValue.fault_plan_info_id, | |||||
// tenant_id: preValue.create_by, | |||||
// tenantsid: preValue.create_by, | |||||
edit_type: preValue.edit_type, | |||||
operate: preValue.operate, | |||||
operation: preValue.operation, | |||||
sequence: preValue.sequence, | |||||
value: preValue.value, | |||||
waiting_time: preValue.waiting_time, | |||||
uuid: preValue.uuid, | |||||
}); | |||||
tableList[upIndex - 1].patchValue({ | |||||
create_by: currentValue.create_by, | |||||
create_date: currentValue.create_date, | |||||
creator_name: currentValue.creator_name, | |||||
fault_plan_info_basic_details_id: | |||||
currentValue.fault_plan_info_basic_details_id, | |||||
fault_plan_info_id: currentValue.fault_plan_info_id, | |||||
// tenant_id: preValue.create_by, | |||||
// tenantsid: preValue.create_by, | |||||
edit_type: currentValue.edit_type, | |||||
operate: currentValue.operate, | |||||
operation: currentValue.operation, | |||||
sequence: currentValue.sequence, | |||||
value: currentValue.value, | |||||
waiting_time: currentValue.waiting_time, | |||||
uuid: currentValue.uuid, | |||||
}); | |||||
console.log('upIndex', upIndex); | |||||
tableList[upIndex].get('sequence').patchValue(upIndex + 1); | |||||
tableList[upIndex - 1].get('sequence').patchValue(upIndex); | |||||
this.changeRef.markForCheck(); | |||||
} | |||||
} | |||||
downRow() { | |||||
const downIndex = this.group.parent.parent | |||||
.get('fault_plan_info_basic_details') | |||||
.value.findIndex( | |||||
(product) => product.sequence === this.group.get('sequence').value | |||||
); | |||||
if (downIndex !== this.tableList['control'].value.length - 1) { | |||||
console.log('tableList', this.tableList); | |||||
const currentValue = | |||||
this.tableList['control']['controls'][downIndex].value; | |||||
const afterValue = | |||||
this.tableList['control']['controls'][downIndex + 1].value; | |||||
const tableList = ( | |||||
this.group.parent.parent.get( | |||||
'fault_plan_info_basic_details' | |||||
) as DwFormArray | |||||
).controls; | |||||
tableList[downIndex].patchValue({ | |||||
create_by: afterValue.create_by, | |||||
create_date: afterValue.create_date, | |||||
creator_name: afterValue.creator_name, | |||||
fault_plan_info_basic_details_id: | |||||
afterValue.fault_plan_info_basic_details_id, | |||||
fault_plan_info_id: afterValue.fault_plan_info_id, | |||||
edit_type: afterValue.edit_type, | |||||
operate: afterValue.operate, | |||||
operation: afterValue.operation, | |||||
sequence: afterValue.sequence, | |||||
value: afterValue.value, | |||||
waiting_time: afterValue.waiting_time, | |||||
uuid: afterValue.uuid, | |||||
}); | |||||
tableList[downIndex + 1].patchValue({ | |||||
create_by: currentValue.create_by, | |||||
create_date: currentValue.create_date, | |||||
creator_name: currentValue.creator_name, | |||||
fault_plan_info_basic_details_id: | |||||
currentValue.fault_plan_info_basic_details_id, | |||||
fault_plan_info_id: currentValue.fault_plan_info_id, | |||||
edit_type: currentValue.edit_type, | |||||
operate: currentValue.operate, | |||||
operation: currentValue.operation, | |||||
sequence: currentValue.sequence, | |||||
value: currentValue.value, | |||||
waiting_time: currentValue.waiting_time, | |||||
uuid: currentValue.uuid, | |||||
}); | |||||
// console.log('downIndex', downIndex); | |||||
tableList[downIndex].get('sequence').patchValue(downIndex + 1); | |||||
tableList[downIndex + 1].get('sequence').patchValue(downIndex + 2); | |||||
this.changeRef.markForCheck(); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { FaultPlanOperateFiledComponent } from './fault-plan-operate-filed.component'; | |||||
@NgModule({ | |||||
declarations: [ FaultPlanOperateFiledComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class FaultPlanOperateFiledModule {} |
@ -0,0 +1,50 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class FaultPlanOperateFiledService{ | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,47 @@ | |||||
<div class="device-detail"> | |||||
<div style="margin-left: 20px;"> | |||||
<span style="color:rgb(115, 216, 151) ;" *ngIf="!shutdown">正常</span> | |||||
<span style="color:red ;" *ngIf="shutdown"> | |||||
<i class="icon" athIcon iconfont="iconguanbi"></i> | |||||
停机</span> | |||||
</div> | |||||
<button ath-button athType="cell-link" (click)="openModal(9, 'form-modal')"> | |||||
设备详情 | |||||
</button> | |||||
<ng-template #deviceDetailTemplateRef> | |||||
<div style="margin-bottom: 20px;"> | |||||
<span style="padding-right: 20px;"> | |||||
故障设备:{{classification_name}} - {{equipment_name}} | |||||
</span> | |||||
<span> | |||||
车间:{{workshop}} - {{product_line}} | |||||
</span> | |||||
</div> | |||||
<ath-tabs [navStyle]="'button'" [fontSize]="'14px'"> | |||||
<ath-tab *ngFor="let tab of tabsList; let i = index"[nzTitle]="tab" (nzClick)="clickTab(i)"> | |||||
<!-- 运行参数 --> | |||||
<ath-table *ngIf="showTab===1" | |||||
#athenaTable1 | |||||
height="400" | |||||
[rowData]="operateList" | |||||
[columnDefs]="operateColumnDefs" | |||||
></ath-table> | |||||
<ath-table | |||||
*ngIf="showTab===2" | |||||
#athenaTable2 | |||||
height="400" | |||||
[rowData]="recordList" | |||||
[columnDefs]="recordColumnDefs" | |||||
></ath-table> | |||||
<ath-table | |||||
*ngIf="showTab===3" | |||||
#athenaTable3 | |||||
height="400" | |||||
[rowData]="maintenanceList" | |||||
[columnDefs]="maintenanceColumnDefs" | |||||
></ath-table> | |||||
</ath-tab> | |||||
</ath-tabs> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.device-detail{ | |||||
} |
@ -0,0 +1,190 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicDeviceDetailModel } from 'app/implementation/model/device-detail/device-detail.model'; | |||||
import { DeviceDetailService } from './device-detail.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/src/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
@Component({ | |||||
selector: 'app-device-detail', | |||||
templateUrl: './device-detail.component.html', | |||||
styleUrls: ['./device-detail.component.less'], | |||||
providers: [DeviceDetailService, CommonService], | |||||
}) | |||||
export class DeviceDetailComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicDeviceDetailModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('deviceDetailTemplateRef') | |||||
deviceDetailTemplateRef: TemplateRef<any>; | |||||
classification_code: any; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private deviceDetailService: DeviceDetailService, | |||||
public commonService: CommonService, | |||||
public modalService: AthModalService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
tabsList = ['运行参数', '操作记录', '维修档案']; | |||||
tableList = []; | |||||
operateList = []; | |||||
operateColumnDefs = [ | |||||
{ headerName: '运行参数', field: 'running_parameter', minWidth: 200 }, | |||||
{ headerName: '数值', field: 'value', minWidth: 200 }, | |||||
{ headerName: '单位', field: 'unit', minWidth: 200 }, | |||||
]; | |||||
recordList = []; | |||||
recordColumnDefs = [ | |||||
{ headerName: '操作时间', field: 'operate_time' }, | |||||
{ headerName: '执行操作', field: 'operation' }, | |||||
{ headerName: '操作值', field: 'value' }, | |||||
]; | |||||
maintenanceList = []; | |||||
maintenanceColumnDefs = [ | |||||
{ headerName: '保养日期', field: 'actual_finish_datetime' }, | |||||
{ headerName: '保养类型', field: 'maintenance_type' }, | |||||
{ headerName: '主修人', field: 'maintenance_worker_name' }, // 拼接 major_person_code+major_person_name | |||||
]; | |||||
showTab = 0; | |||||
shutdown: Boolean; | |||||
classification_name: ''; // 设备类型 | |||||
equipment_name: ''; // 设备名称 | |||||
workshop: ''; // 车间 | |||||
product_line: ''; // 产线 | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
this.shutdown = this.group.get('shutdown').value; | |||||
this.classification_name = this.group.get('classification_name').value; | |||||
this.equipment_name = this.group.get('equipment_name').value; | |||||
this.workshop = this.group.get('workshop').value; | |||||
this.product_line = this.group.get('product_line').value; | |||||
this.classification_code = | |||||
this.group.get('classification_code').value || ''; | |||||
} | |||||
getTableList() { | |||||
// 运行参数 | |||||
this.deviceDetailService.ca_efm_running_param_info_get({}).then((res) => { | |||||
this.operateList = res; | |||||
}); | |||||
// 操作记录 | |||||
const operate_record_info = [ | |||||
{ | |||||
classification_code: this.classification_code, | |||||
equipment_model: this.group.get('equipment_model').value, | |||||
fault_category_code: this.group.get('fault_category_code').value, | |||||
fault_code: this.group.get('fault_code').value, | |||||
plan_version: this.group.get('plan_version').value, | |||||
equipment_fault_info_id: this.group.get('id').value, | |||||
}, | |||||
]; | |||||
this.deviceDetailService | |||||
.ca_efm_operate_record_info_get(operate_record_info) | |||||
.then((res) => { | |||||
this.recordList = res; | |||||
}); | |||||
// 维修档案 TODO数据中台 | |||||
const params = { | |||||
equipment_code: this.group.get('equipment_no').value, | |||||
// equipment_code: 'a2a499d1', | |||||
row_nums: '1000', | |||||
}; | |||||
this.commonService | |||||
.maintenanceDmcUrl({ | |||||
params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
// this.maintenanceList = res.data; | |||||
if (res.data.length) { | |||||
res.data.forEach((item) => { | |||||
const obj = { | |||||
actual_finish_datetime: item.actual_finish_datetime | |||||
? this.formatDateString(item.actual_finish_datetime) | |||||
: '', | |||||
maintenance_type: item.maintenance_type, | |||||
maintenance_worker_name: | |||||
item.maintenance_worker_name + | |||||
'-' + | |||||
item.maintenance_worker_code, | |||||
}; | |||||
this.maintenanceList.push(obj); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
/** | |||||
* 格式化时间 | |||||
* @param dateString | |||||
* @returns | |||||
*/ | |||||
formatDateString(dateString) { | |||||
// 创建一个 Date 对象 | |||||
const date = new Date(dateString); | |||||
// 获取年、月、日、时、分、秒 | |||||
const year = date.getFullYear(); | |||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的,所以需要加1 | |||||
const day = String(date.getDate()).padStart(2, '0'); | |||||
const hours = String(date.getHours()).padStart(2, '0'); | |||||
const minutes = String(date.getMinutes()).padStart(2, '0'); | |||||
const seconds = String(date.getSeconds()).padStart(2, '0'); | |||||
// 格式化为 YY/MM/DD hh:mm:ss | |||||
const formattedDate = `${year | |||||
.toString() | |||||
.slice(-2)}/${month}/${day} ${hours}:${minutes}:${seconds}`; | |||||
return formattedDate; | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
this.getTableList(); | |||||
this.showTab = 1; | |||||
return this.modalService.create({ | |||||
nzTitle: '设备详情', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.deviceDetailTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
}); | |||||
} | |||||
clickTab(index) { | |||||
this.showTab = index + 1; | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { DeviceDetailComponent } from './device-detail.component'; | |||||
@NgModule({ | |||||
declarations: [ DeviceDetailComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class DeviceDetailModule {} |
@ -0,0 +1,72 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class DeviceDetailService { | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
// 运行参数 | |||||
ca_efm_running_param_info_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.running.param.info.get', {}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.running_parameter_info); | |||||
}); | |||||
}); | |||||
} | |||||
// 操作记录 | |||||
ca_efm_operate_record_info_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.operate.record.info.get', { | |||||
operate_record_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.operate_record_info); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,230 @@ | |||||
/* eslint-disable quotes */ | |||||
export default [ | |||||
{ | |||||
headerName: '负责人', | |||||
path: 'trans_task_info', | |||||
width: 100, | |||||
columns: [ | |||||
{ | |||||
schema: 'is_responsible', | |||||
headerName: '负责人', | |||||
dataType: 'boolean', | |||||
editor: { | |||||
id: '3c01d0f0-6bc8-49a2-8668-c568e3c92a93', | |||||
type: 'CHECKBOX', | |||||
schema: 'is_responsible', | |||||
editable: false, | |||||
}, | |||||
operations: [], | |||||
filter: { | |||||
placeholder: '请输入关键词过滤', | |||||
type: 'input', | |||||
}, | |||||
}, | |||||
], | |||||
}, | |||||
{ | |||||
headerName: '人员', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'NAME_CODE_COMPONENT', | |||||
schema: 'eoc_name', | |||||
headerName: '人员姓名', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
sortable: true, | |||||
width: 190, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'eoc_name', | |||||
headerName: '人员姓名', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
filterable: true, | |||||
rowGroupable: true, | |||||
width: 119, | |||||
important: false, | |||||
}, | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'employee_no', | |||||
headerName: '人员编号', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
filterable: true, | |||||
rowGroupable: true, | |||||
width: 190, | |||||
important: false, | |||||
}, | |||||
], | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
// { | |||||
// headerName: '姓名', | |||||
// path: 'trans_task_info', | |||||
// level: 0, | |||||
// description: '', | |||||
// operations: [], | |||||
// width: 200, | |||||
// hide: false, | |||||
// important: false, | |||||
// columns: [ | |||||
// { | |||||
// type: 'LABEL', | |||||
// schema: 'eoc_name', | |||||
// headerName: '姓名', | |||||
// path: 'trans_task_info', | |||||
// level: 0, | |||||
// disabled: false, | |||||
// editable: false, | |||||
// dataType: 'string', | |||||
// sortable: true, | |||||
// width: 200, | |||||
// important: false, | |||||
// }, | |||||
// ], | |||||
// headers: [], | |||||
// isUserDefined: false, | |||||
// }, | |||||
{ | |||||
headerName: '状态', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 100, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'SELECT', | |||||
schema: 'occupied_state', | |||||
headerName: '状态', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
options: [ | |||||
{ | |||||
language: '', | |||||
title: '已派遣', | |||||
value: '1', | |||||
}, | |||||
{ | |||||
language: '', | |||||
title: '占用中', | |||||
value: '2', | |||||
}, | |||||
{ | |||||
language: '', | |||||
title: '空闲中', | |||||
value: '3', | |||||
}, | |||||
], | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '当前任务', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'TEXTAREA', | |||||
schema: 'current_task', | |||||
headerName: '当前任务', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '预计可用时间', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'plan_complete_time', | |||||
headerName: '预计可用时间', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '操作', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 250, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'setting-btn', | |||||
schema: 'operate', | |||||
headerName: '操作', | |||||
path: 'trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 250, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
]; |
@ -0,0 +1,22 @@ | |||||
<div class="dispatch-list"> | |||||
<div> | |||||
{{group.get('employee_name_responsible').value}} | |||||
</div> | |||||
<div> | |||||
{{group.get('employee_no_responsible').value}} | |||||
</div> | |||||
<button ath-button athType="cell-link" (click)="openModal(20, 'form-modal')"> | |||||
派遣清单 | |||||
</button> | |||||
<ng-template #dispatchListTemplateRef> | |||||
<div | |||||
style="height: 300px" | |||||
dynamic-ant-form-control | |||||
class="table-content" | |||||
*ngFor="let model of formModel" | |||||
[model]="model" | |||||
[group]="formGroup" | |||||
></div> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.dispatch-list{ | |||||
} |
@ -0,0 +1,204 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicDispatchListModel } from 'app/implementation/model/dispatch-list/dispatch-list.model'; | |||||
import { DispatchListService } from './dispatch-list.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
import column from './column'; | |||||
@Component({ | |||||
selector: 'app-dispatch-list', | |||||
templateUrl: './dispatch-list.component.html', | |||||
styleUrls: ['./dispatch-list.component.less'], | |||||
providers: [DispatchListService], | |||||
}) | |||||
export class DispatchListComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicDispatchListModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('dispatchListTemplateRef') | |||||
dispatchListTemplateRef: TemplateRef<any>; | |||||
formGroup: FormGroup; | |||||
tableList = []; | |||||
pageCode: any; | |||||
flag = true; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private dispatchListService: DispatchListService, | |||||
public commonService: CommonService, | |||||
public modalService: AthModalService, | |||||
public formService: DynamicFormService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
this.pageCode = this.commonService.content.pageCode; | |||||
this.commonService.messageSource.subscribe((message) => { | |||||
if (message === true) { | |||||
// debugger; | |||||
this.getTableList(); | |||||
// this.modalService.closeAll(); | |||||
// this.change.emit({ | |||||
// type: 'application-submit', | |||||
// }); | |||||
// this.changeRef.markForCheck(); | |||||
} | |||||
}); | |||||
// console.log('group', this.group.value); | |||||
} | |||||
// eslint-disable-next-line @angular-eslint/use-lifecycle-interface | |||||
ngOnDestroy(): void { | |||||
// this.commonService.messageSource.unsubscribe(); | |||||
// this.commonService.messageSource.complete(); | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
this.getTableList(); | |||||
sessionStorage.setItem( | |||||
'equipment_fault_info', | |||||
JSON.stringify(this.group.value) | |||||
); | |||||
return this.modalService.create({ | |||||
nzTitle: '派遣清单', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.dispatchListTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
equipment_fault_info: this.group.value, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
// eslint-disable-next-line no-shadow | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
this.change.emit({ | |||||
type: 'application-submit', | |||||
}); | |||||
this.changeRef.markForCheck(); | |||||
return true; | |||||
}, | |||||
}); | |||||
} | |||||
getTableList() { | |||||
this.tableList = []; | |||||
const trans_task_info = [ | |||||
{ | |||||
equipment_fault_info_id: this.group.get('id').value, | |||||
}, | |||||
]; | |||||
this.dispatchListService | |||||
.ca_efm_trans_task_info_get(trans_task_info) | |||||
.then((res) => { | |||||
this.tableList = res; | |||||
// this.flag = true; | |||||
this.initTable(); | |||||
// console.log('tableList', this.tableList); | |||||
}); | |||||
} | |||||
initTable() { | |||||
const source = this.createDynamicTableJSON(); | |||||
source.layout = Array.isArray(source?.layout) ? source.layout : []; | |||||
const initializedData = this.formService.initData( | |||||
source.layout as any, | |||||
source.pageData, | |||||
source.rules as any, | |||||
source.style | |||||
); | |||||
// this.formLayout = initializedData.formLayout; // 样式 | |||||
this.formModel = initializedData.formModel; // 组件数据模型 | |||||
this.formGroup = initializedData.formGroup; // formGroup | |||||
// this.group = initializedData.formGroup; // formGroup | |||||
} | |||||
createDynamicTableJSON() { | |||||
const data = { | |||||
layout: [ | |||||
{ | |||||
id: 'trans_task_info', | |||||
type: 'ATHENA_TABLE', | |||||
editable: true, | |||||
disabledUserDefined: true, | |||||
schema: 'trans_task_info', | |||||
scriptFilters: [], | |||||
setting: { | |||||
hideDefaultToolbar: ['composite-sort', 'setting'], | |||||
}, | |||||
columnDefs: this.getColumn(), | |||||
allFields: [], | |||||
}, | |||||
], | |||||
pageData: { | |||||
trans_task_info: this.tableList, | |||||
}, | |||||
rules: [ | |||||
{ | |||||
schema: 'occupied_state', | |||||
path: 'trans_task_info', | |||||
validatorType: 'warning', | |||||
errorMessage: '', | |||||
trigger: { | |||||
condition: | |||||
"data.occupied_state==='3'?'blue':(data.occupied_state==='1'?'green':'red')", | |||||
point: 'default', | |||||
type: 'sync', | |||||
}, | |||||
key: 'style', | |||||
crossFieldOrNot: false, | |||||
}, | |||||
], | |||||
content: {}, | |||||
style: {}, | |||||
}; | |||||
return data; | |||||
} | |||||
getColumn() { | |||||
const materialcolums = JSON.parse(JSON.stringify(column)); | |||||
// eslint-disable-next-line no-shadow | |||||
const res = materialcolums.map((column) => { | |||||
return { | |||||
...column, | |||||
}; | |||||
}); | |||||
return res; | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { DispatchListComponent } from './dispatch-list.component'; | |||||
@NgModule({ | |||||
declarations: [ DispatchListComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class DispatchListModule {} |
@ -0,0 +1,64 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class DispatchListService { | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
/** | |||||
* 设备清单get接口 | |||||
*/ | |||||
ca_efm_trans_task_info_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.trans.task.info.get', { | |||||
trans_task_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.trans_task_info); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,246 @@ | |||||
/* eslint-disable quotes */ | |||||
export default [ | |||||
{ | |||||
headerName: '设备号', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'equipment_code', | |||||
headerName: '设备号', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障分类', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'failure_category_name', | |||||
headerName: '故障分类', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障码', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'failure_name', | |||||
headerName: '故障码', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障现象', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'TEXTAREA', | |||||
schema: 'failure_phenomenon', | |||||
headerName: '故障现象', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障原因', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'TEXTAREA', | |||||
schema: 'failure_reason', | |||||
headerName: '故障原因', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: false, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障部件', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'failure_parts', | |||||
headerName: '故障部件', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障次数', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'failure_number', | |||||
headerName: '故障次数', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'numeric', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '停机时数', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 200, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'LABEL', | |||||
schema: 'failure_shutdown_hours', | |||||
headerName: '停机时数', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'numeric', | |||||
sortable: true, | |||||
width: 200, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
{ | |||||
headerName: '故障明细', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
description: '', | |||||
operations: [], | |||||
width: 250, | |||||
hide: false, | |||||
important: false, | |||||
columns: [ | |||||
{ | |||||
type: 'fault-detail-btn', | |||||
schema: 'fault_detail', | |||||
headerName: '故障明细', | |||||
path: 'equipment_fault.trans_task_info', | |||||
level: 0, | |||||
disabled: false, | |||||
editable: true, | |||||
dataType: 'string', | |||||
sortable: true, | |||||
width: 250, | |||||
important: false, | |||||
}, | |||||
], | |||||
headers: [], | |||||
isUserDefined: false, | |||||
}, | |||||
]; |
@ -0,0 +1,20 @@ | |||||
<div class="fault-count"> | |||||
<p>{{group.get('equipment_model').value}}</p> | |||||
<p>{{group.get('equipment_name').value}}</p> | |||||
<button ath-button athType="cell-link" (click)="openModal(16, 'form-modal')"> | |||||
故障统计 | |||||
</button> | |||||
<ng-template #faultCountTemplateRef> | |||||
设备90天内主要故障统计 | |||||
<div> | |||||
<div | |||||
style="height: 300px" | |||||
dynamic-ant-form-control | |||||
class="table-content" | |||||
*ngFor="let model of formModel" | |||||
[model]="model" | |||||
[group]="formGroup" | |||||
></div> | |||||
</div> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.fault-count{ | |||||
} |
@ -0,0 +1,184 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicFaultCountModel } from 'app/implementation/model/fault-count/fault-count.model'; | |||||
import { FaultCountService } from './fault-count.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/src/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
import column from './column'; | |||||
@Component({ | |||||
selector: 'app-fault-count', | |||||
templateUrl: './fault-count.component.html', | |||||
styleUrls: ['./fault-count.component.less'], | |||||
providers: [FaultCountService, CommonService], | |||||
}) | |||||
export class FaultCountComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicFaultCountModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('faultCountTemplateRef') faultCountTemplateRef: TemplateRef<any>; | |||||
formGroup: FormGroup; | |||||
falutList = []; | |||||
year: number; | |||||
month: number; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private faultCountService: FaultCountService, | |||||
public modalService: AthModalService, | |||||
public formService: DynamicFormService, | |||||
public commonService: CommonService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
const dateString = this.group.get('report_time').value; | |||||
if (dateString) { | |||||
const result = this.getPreviousMonthYearMonth(dateString); | |||||
this.year = result.year; | |||||
this.month = result.month; | |||||
} | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
sessionStorage.setItem( | |||||
'equipment_fault_info1', | |||||
JSON.stringify(this.group.value) | |||||
); | |||||
this.getTableList(); | |||||
return this.modalService.create({ | |||||
nzTitle: '故障统计', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.faultCountTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
}); | |||||
} | |||||
initTable() { | |||||
const source = this.createDynamicTableJSON(); | |||||
source.layout = Array.isArray(source?.layout) ? source.layout : []; | |||||
const initializedData = this.formService.initData( | |||||
source.layout as any, | |||||
source.pageData, | |||||
source.rules as any, | |||||
source.style | |||||
); | |||||
// this.formLayout = initializedData.formLayout; // 样式 | |||||
this.formModel = initializedData.formModel; // 组件数据模型 | |||||
this.formGroup = initializedData.formGroup; // formGroup | |||||
// this.group = initializedData.formGroup; // formGroup | |||||
} | |||||
createDynamicTableJSON() { | |||||
const data = { | |||||
layout: [ | |||||
{ | |||||
id: 'equipment_fault_info.trans_task_info', | |||||
type: 'ATHENA_TABLE', | |||||
editable: true, | |||||
disabledUserDefined: true, | |||||
schema: 'equipment_fault_info.trans_task_info', | |||||
scriptFilters: [], | |||||
setting: { | |||||
hideDefaultToolbar: ['composite-sort', 'setting'], | |||||
}, | |||||
columnDefs: this.getColumn(), | |||||
allFields: [], | |||||
}, | |||||
], | |||||
pageData: { | |||||
equipment_fault_info: { | |||||
trans_task_info: this.falutList, | |||||
}, | |||||
}, | |||||
rules: [], | |||||
content: {}, | |||||
style: {}, | |||||
}; | |||||
return data; | |||||
} | |||||
getColumn() { | |||||
const materialcolums = JSON.parse(JSON.stringify(column)); | |||||
// eslint-disable-next-line no-shadow | |||||
const res = materialcolums.map((column) => { | |||||
return { | |||||
...column, | |||||
}; | |||||
}); | |||||
return res; | |||||
} | |||||
getTableList() { | |||||
// 入参:年份(year)、月份(month为当前故障发生时间所在年月-1)、设备编号(equipment_code) | |||||
// TODO数据中台 | |||||
const params = { | |||||
equipment_code: this.group.get('equipment_no').value, | |||||
// equipment_code: 'a2a499d1', | |||||
year: this.year.toString(), | |||||
month: this.month.toString(), | |||||
}; | |||||
this.commonService.faultCountDmcUrl({ params }).subscribe((res): void => { | |||||
this.falutList = res.data; | |||||
this.falutList.forEach((item) => { | |||||
item.failure_name = item.failure_name + '-' + item.failure_code; | |||||
}); | |||||
this.initTable(); | |||||
}); | |||||
} | |||||
/** | |||||
* 获取年份、月份 | |||||
*/ | |||||
getPreviousMonthYearMonth(dateString) { | |||||
const date = new Date(dateString); | |||||
const year = date.getFullYear(); | |||||
const month = date.getMonth(); // 注意:月份是从0开始的,需要加1才能得到正常的月份数字 | |||||
const previousMonth = month - 1; | |||||
const previousYear = previousMonth === -1 ? year - 1 : year; // 如果上个月是12月则年份减1 | |||||
const previousMonthNumber = previousMonth === -1 ? 12 : previousMonth + 1; | |||||
return { | |||||
year: previousYear, | |||||
month: previousMonthNumber, | |||||
}; | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { FaultCountComponent } from './fault-count.component'; | |||||
@NgModule({ | |||||
declarations: [ FaultCountComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class FaultCountModule {} |
@ -0,0 +1,50 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class FaultCountService { | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
<div class="fault-detail-btn"> | |||||
<button ath-button athType="cell-link" (click)="openModal(10, 'form-modal')"> | |||||
查看近期故障 | |||||
</button> | |||||
<ng-template #faultDetailTemplateRef> | |||||
<ath-table | |||||
#athenaTable1 | |||||
height="400" | |||||
[rowData]="faultDetailList" | |||||
[columnDefs]="faultDetailColumnDefs" | |||||
></ath-table> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.fault-detail-btn{ | |||||
} |
@ -0,0 +1,175 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicFaultDetailBtnModel } from 'app/implementation/model/fault-detail-btn/fault-detail-btn.model'; | |||||
import { FaultDetailBtnService } from './fault-detail-btn.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/src/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
@Component({ | |||||
selector: 'app-fault-detail-btn', | |||||
templateUrl: './fault-detail-btn.component.html', | |||||
styleUrls: ['./fault-detail-btn.component.less'], | |||||
providers: [FaultDetailBtnService, CommonService], | |||||
}) | |||||
export class FaultDetailBtnComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicFaultDetailBtnModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('faultDetailTemplateRef') faultDetailTemplateRef: TemplateRef<any>; | |||||
faultDetailList = []; | |||||
faultDetailColumnDefs = [ | |||||
{ headerName: '故障发生时间', field: 'failure_datetime' }, | |||||
{ headerName: '故障分类', field: 'failure_category_name' }, | |||||
{ headerName: '故障码', field: 'failure_name' }, // 拼接code | |||||
{ headerName: '故障现象', field: 'failure_phenomenon' }, | |||||
{ headerName: '故障原因', field: 'failure_reason' }, | |||||
{ headerName: '故障部件', field: 'failure_parts' }, // 拼接code | |||||
{ headerName: '处理经过', field: 'handling_process' }, | |||||
{ headerName: '处理人', field: 'exclude_failure_staff_name' }, // 拼接code | |||||
{ headerName: '故障解决时间', field: 'exclude_failure_datetime' }, // 拼接code | |||||
]; | |||||
equipment_fault_info: any; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private faultDetailBtnService: FaultDetailBtnService, | |||||
public modalService: AthModalService, | |||||
public commonService: CommonService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
firstDay: string; | |||||
lastDay: string; | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
// console.log('group--故障明细', this.group); | |||||
// 获取故障上报时间 | |||||
const equipment_fault_info = sessionStorage.getItem( | |||||
'equipment_fault_info1' | |||||
); | |||||
this.equipment_fault_info = JSON.parse(equipment_fault_info); | |||||
const dateString = this.equipment_fault_info.report_time; | |||||
if (dateString) { | |||||
const result = this.getPreviousMonthRange(dateString); | |||||
this.firstDay = result.firstDay; | |||||
this.lastDay = result.lastDay; | |||||
} | |||||
} | |||||
formatDateString(dateString) { | |||||
// 创建一个 Date 对象 | |||||
const date = new Date(dateString); | |||||
// 获取年、月、日、时、分、秒 | |||||
const year = date.getFullYear(); | |||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的,所以需要加1 | |||||
const day = String(date.getDate()).padStart(2, '0'); | |||||
const hours = String(date.getHours()).padStart(2, '0'); | |||||
const minutes = String(date.getMinutes()).padStart(2, '0'); | |||||
const seconds = String(date.getSeconds()).padStart(2, '0'); | |||||
// 格式化为 YY/MM/DD hh:mm:ss | |||||
const formattedDate = `${year | |||||
.toString() | |||||
.slice(-2)}/${month}/${day} ${hours}:${minutes}:${seconds}`; | |||||
return formattedDate; | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
this.getTableList(); | |||||
return this.modalService.create({ | |||||
nzTitle: '当前生产计划', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.faultDetailTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
}); | |||||
} | |||||
getTableList() { | |||||
// 入参:年份(year)、月份(month为当前故障发生时间所在年月-1)、设备编号(equipment_code) | |||||
// TODO数据中台 | |||||
const params = { | |||||
equipment_code: this.group.get('equipment_code').value, | |||||
// equipment_code: '65eb49eb', | |||||
failure_datetime_start: this.firstDay, | |||||
failure_datetime_end: this.lastDay, | |||||
}; | |||||
this.commonService | |||||
.faultCountDetailDmcUrl({ params }) | |||||
.subscribe((res): void => { | |||||
// this.faultDetailList = res.data; | |||||
if (res.data.length) { | |||||
res.data.forEach((item) => { | |||||
item.failure_datetime = item.failure_datetime | |||||
? this.formatDateString(item.failure_datetime) | |||||
: ''; | |||||
item.exclude_failure_datetime = item.exclude_failure_datetime | |||||
? this.formatDateString(item.exclude_failure_datetime) | |||||
: ''; | |||||
item.failure_name = item.failure_name + '-' + item.failure_code; | |||||
item.exclude_failure_staff_name = | |||||
item.exclude_failure_staff_name + | |||||
'-' + | |||||
item.exclude_failure_staff_code; | |||||
}); | |||||
this.faultDetailList = res.data; | |||||
} | |||||
}); | |||||
} | |||||
formatDate(date) { | |||||
const year = date.getFullYear(); | |||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要+1并补零 | |||||
const day = String(date.getDate()).padStart(2, '0'); | |||||
const hours = String(date.getHours()).padStart(2, '0'); | |||||
const minutes = String(date.getMinutes()).padStart(2, '0'); | |||||
const seconds = String(date.getSeconds()).padStart(2, '0'); | |||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; | |||||
} | |||||
getPreviousMonthRange(dateString) { | |||||
const date = new Date(dateString); | |||||
const year = date.getFullYear(); | |||||
const month = date.getMonth(); | |||||
const firstDayLastMonth = new Date(year, month - 1, 1); | |||||
const lastDayLastMonth = new Date(year, month, 0); | |||||
return { | |||||
firstDay: this.formatDate(firstDayLastMonth), | |||||
lastDay: this.formatDate(lastDayLastMonth), | |||||
}; | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { FaultDetailBtnComponent } from './fault-detail-btn.component'; | |||||
@NgModule({ | |||||
declarations: [ FaultDetailBtnComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class FaultDetailBtnModule {} |
@ -0,0 +1,50 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class FaultDetailBtnService{ | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,42 @@ | |||||
<div class="knowledge-base"> | |||||
<button style="margin-right:20px ;" ath-button athType="primary" (click)="openModal(12, 'form-modal')"> | |||||
查询知识库 | |||||
</button> | |||||
<ng-template #knowledgeTemplateRef> | |||||
<div style="margin-bottom: 20px"> | |||||
<span style="padding-right: 30px"> 设备:{{equipment_model}} - {{equipment_name}} </span> | |||||
<span style="padding-right: 30px"> 故障类别:{{fault_category_name}} </span> | |||||
<span> 故障码:{{fault_code}} </span> | |||||
<div style="margin-top: 10px;"> | |||||
<ath-input-group label="故障部件"> | |||||
<input | |||||
athInput | |||||
type="text" | |||||
placeholder="请输入" | |||||
[(ngModel)]="failure_parts" | |||||
/> | |||||
</ath-input-group> | |||||
<ath-input-group style="margin-top: 10px;" label="故障现象"> | |||||
<input | |||||
athInput | |||||
type="text" | |||||
placeholder="请输入" | |||||
[(ngModel)]="failure_phenomenon" | |||||
/> | |||||
</ath-input-group> | |||||
<button style="margin-top: 20px;" ath-button athType="primary" nzSize="large" (click)="getTableList()">查询</button> | |||||
</div> | |||||
</div> | |||||
<ath-table | |||||
#athenaTable | |||||
checkboxBindField="checked" | |||||
[rowCheckbox]="true" | |||||
rowSelection="single" | |||||
height="400" | |||||
[rowData]="tableList" | |||||
[columnDefs]="columnDefs" | |||||
(rowSelected)="rowSelected($event)" | |||||
rowHeight="50" | |||||
></ath-table> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.knowledge-base{ | |||||
} |
@ -0,0 +1,152 @@ | |||||
import { menuData } from './../../../menu/model/menu.model'; | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicKnowledgeBaseModel } from 'app/implementation/model/knowledge-base/knowledge-base.model'; | |||||
import { KnowledgeBaseService } from './knowledge-base.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/src/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
@Component({ | |||||
selector: 'app-knowledge-base', | |||||
templateUrl: './knowledge-base.component.html', | |||||
styleUrls: ['./knowledge-base.component.less'], | |||||
providers: [KnowledgeBaseService, CommonService], | |||||
}) | |||||
export class KnowledgeBaseComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicKnowledgeBaseModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('knowledgeTemplateRef') knowledgeTemplateRef: TemplateRef<any>; | |||||
failure_parts = ''; | |||||
failure_phenomenon = ''; | |||||
columnDefs: any[] = [ | |||||
{ headerName: '故障部件', field: 'failure_parts' }, | |||||
{ headerName: '故障现象', field: 'failure_phenomenon' }, | |||||
{ headerName: '故障原因', field: 'failure_reason' }, | |||||
{ headerName: '故障处理措施', field: 'handling_measures' }, | |||||
{ headerName: '备注', field: 'remarks' }, | |||||
]; | |||||
tableList = []; | |||||
equipment_model: any; | |||||
equipment_name: any; | |||||
fault_category_name: any; | |||||
fault_code: any; | |||||
equipment_type: any; | |||||
selectData: any = {}; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private knowledgeBaseService: KnowledgeBaseService, | |||||
public modalService: AthModalService, | |||||
public formService: DynamicFormService, | |||||
public commonService: CommonService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
// console.log('group', this.group.value['handling_info'][0]); | |||||
// 一条任务卡一条数据 | |||||
const group = this.group.value['handling_info']; | |||||
this.equipment_model = group.equipment_model; | |||||
this.equipment_name = group.equipment_name; | |||||
this.fault_category_name = group.fault_category_name; | |||||
this.fault_code = group.fault_code; | |||||
this.equipment_type = group.classification_name; // 设备分类 | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
return this.modalService.create({ | |||||
nzTitle: '知识库', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.knowledgeTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
if (this.selectData) { | |||||
// 将故障原因、问题部件、处理方案带回页面 | |||||
const failure_reason = this.selectData.failure_reason || ''; | |||||
const handling_measures = this.selectData.handling_measures || ''; | |||||
const failure_parts = this.selectData.failure_parts || ''; | |||||
// 故障原因 | |||||
this.group.controls['handling_info'] | |||||
.get('fault_reason') | |||||
.patchValue(failure_reason); | |||||
// 问题部件 | |||||
this.group.controls['handling_info'] | |||||
.get('fault_parts') | |||||
.patchValue(failure_parts); | |||||
// 处理方案 | |||||
this.group.controls['handling_info'] | |||||
.get('fault_action') | |||||
.patchValue(handling_measures); | |||||
} | |||||
return true; | |||||
}, | |||||
}); | |||||
} | |||||
getTableList() { | |||||
// 入参:设备分类equipment_type 、故障部件failure_parts like 、故障现象failure_phenomenon like、 | |||||
const params = { | |||||
// equipment_type: '加工自动线', | |||||
// failure_parts: '机械臂', | |||||
// failure_phenomenon: '异常', | |||||
equipment_type: this.equipment_type, | |||||
failure_parts: this.failure_parts, | |||||
failure_phenomenon: this.failure_phenomenon, | |||||
}; | |||||
this.commonService | |||||
.knowledgeBaseDmcUrl({ | |||||
params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
this.tableList = res.data; | |||||
}); | |||||
} | |||||
rowSelected(event) { | |||||
console.log('event', event); | |||||
this.selectData = event.data; | |||||
console.log('group', this.group); | |||||
// node.setDataValue('uibot_checked', node.selected); | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { KnowledgeBaseComponent } from './knowledge-base.component'; | |||||
@NgModule({ | |||||
declarations: [ KnowledgeBaseComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class KnowledgeBaseModule {} |
@ -0,0 +1,50 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class KnowledgeBaseService{ | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,6 @@ | |||||
<div class="product-plan"> | |||||
<!-- <button ath-button athType="cell-link" (click)="openModal(8, 'form-modal')"> | |||||
当前生产计划 | |||||
</button> --> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.product-plan{ | |||||
} |
@ -0,0 +1,65 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicProductPlanModel } from 'app/implementation/model/product-plan/product-plan.model'; | |||||
import { ProductPlanService } from './product-plan.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthTableComponent } from '@athena/design-ui'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
import { AthGridModalType } from '@athena/design-ui/components/modal/modal-types'; | |||||
@Component({ | |||||
selector: 'app-product-plan', | |||||
templateUrl: './product-plan.component.html', | |||||
styleUrls: ['./product-plan.component.less'], | |||||
providers: [ProductPlanService, CommonService], | |||||
}) | |||||
export class ProductPlanComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicProductPlanModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('athenaTable', { static: true }) athenaTable: AthTableComponent; | |||||
@ViewChild('productPlanTemplateRef') productPlanTemplateRef: TemplateRef<any>; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private productPlanService: ProductPlanService, | |||||
public commonService: CommonService, | |||||
public modalService: AthModalService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
// this.getTableList(); | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { ProductPlanComponent } from './product-plan.component'; | |||||
@NgModule({ | |||||
declarations: [ ProductPlanComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class ProductPlanModule {} |
@ -0,0 +1,35 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class ProductPlanService { | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,25 @@ | |||||
<div class="setting-btn"> | |||||
<span class="btn-box" *ngIf="!is_responsible && status!=='2' " (click)="openPersonModal(8, 'form-modal',1)">设置负责人</span> | |||||
<span class="btn-box" *ngIf="!is_responsible && occupied_state !=='1'&& status!=='2' " (click)="openDispatchModal(8, 'form-modal',2)">加派辅助</span> | |||||
<span class="btn-box" *ngIf="!is_responsible && occupied_state==='1'&& status!=='2'" (click)="openWithDrawModal(8, 'form-modal')">撤回</span> | |||||
<ng-template #setPersonTemplateRef> | |||||
<!-- 设置负责人 --> | |||||
</ng-template> | |||||
<ng-template #setPersonTemplateRef1> | |||||
<!-- 通知设置负责人 --> | |||||
</ng-template> | |||||
<ng-template #occupiedTemplateRef> | |||||
<!-- 加派 --> | |||||
</ng-template> | |||||
<ng-template #withDrawTemplateRef> | |||||
<!-- 撤回 --> | |||||
<!-- <span class="withdraw-box">确认撤回?</span> --> | |||||
</ng-template> | |||||
<!-- priorityTemplateRef --> | |||||
<ng-template #priorityTemplateRef> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,9 @@ | |||||
.setting-btn { | |||||
.btn-box { | |||||
color: blue; | |||||
padding-right: 15px; | |||||
cursor: pointer; | |||||
} | |||||
.withdraw-box { | |||||
} | |||||
} |
@ -0,0 +1,435 @@ | |||||
/* eslint-disable no-shadow */ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicSettingBtnModel } from 'app/implementation/model/setting-btn/setting-btn.model'; | |||||
import { SettingBtnService } from './setting-btn.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/src/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
import { setTimeout } from 'timers'; | |||||
@Component({ | |||||
selector: 'app-setting-btn', | |||||
templateUrl: './setting-btn.component.html', | |||||
styleUrls: ['./setting-btn.component.less'], | |||||
providers: [SettingBtnService], | |||||
}) | |||||
export class SettingBtnComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicSettingBtnModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
// 设置负责人 | |||||
@ViewChild('setPersonTemplateRef') setPersonTemplateRef: TemplateRef<any>; | |||||
@ViewChild('setPersonTemplateRef1') setPersonTemplateRef1: TemplateRef<any>; | |||||
// occupiedTemplateRef 加派 | |||||
@ViewChild('occupiedTemplateRef') occupiedTemplateRef: TemplateRef<any>; | |||||
// withDrawTemplateRef 撤回 | |||||
@ViewChild('withDrawTemplateRef') withDrawTemplateRef: TemplateRef<any>; | |||||
// priorityTemplateRef | |||||
@ViewChild('priorityTemplateRef') priorityTemplateRef: TemplateRef<any>; | |||||
is_responsible: any; // 是否为负责人 | |||||
occupied_state: any; // 是否已派遣 1(已派遣),2(占用中),3(空闲中) | |||||
have_person: Boolean = true; // 当前列表是否存在负责人 | |||||
priority_type = ''; // 任务占用选择优先级 | |||||
status = '1'; // 故障派遣处理状态=2,全部隐藏 | |||||
equipment_fault_info: any; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private settingBtnService: SettingBtnService, | |||||
public commonService: CommonService, | |||||
public modalService: AthModalService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
// 获取当前列表是否存在负责人;TODO | |||||
// console.log('status', this.commonService.content); | |||||
this.have_person = this.group.parent.value[0].is_responsible; | |||||
this.is_responsible = this.group.get('is_responsible').value; | |||||
this.occupied_state = this.group.get('occupied_state').value; | |||||
// console.log('group-按钮', this.group.value); | |||||
const equipment_fault_info = sessionStorage.getItem('equipment_fault_info'); | |||||
this.equipment_fault_info = JSON.parse(equipment_fault_info); | |||||
// console.log('equipment_fault_info', this.equipment_fault_info); | |||||
this.status = this.equipment_fault_info.status; | |||||
} | |||||
/** | |||||
* 加派 | |||||
* @param columns | |||||
* @param modalType | |||||
* @param type | |||||
* @returns | |||||
*/ | |||||
openPersonModal(columns: number, modalType: AthGridModalType, type) { | |||||
if (this.have_person === false) { | |||||
// 不存在责任人 | |||||
this.settingPerson(); | |||||
} else if (this.have_person === true) { | |||||
// 情况1: 存在责任人,且被占用 | |||||
return this.modalService.create({ | |||||
nzTitle: '故障已指定责任人,是否更换责任人?', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.setPersonTemplateRef1, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
// 当前条目被占用 | |||||
if (this.occupied_state === '2') { | |||||
this.openPriorityModal(8, 'form-modal', type); | |||||
} else { | |||||
// 当前条目未被专用 | |||||
this.settingPerson(); | |||||
} | |||||
return true; | |||||
}, | |||||
}); | |||||
} | |||||
// else if (this.have_person === true && this.occupied_state === '3') { | |||||
// // 情况2:存在负责人且当前人员空闲,是否替换责任人 | |||||
// return this.modalService.create({ | |||||
// nzTitle: '故障已指定责任人,是否更换责任人?', | |||||
// nzWrapClassName: 'ath-grid-modal-wrap', | |||||
// nzContent: this.setPersonTemplateRef, | |||||
// nzComponentParams: { | |||||
// span: columns, | |||||
// modalType: modalType, | |||||
// }, | |||||
// gridConfig: { | |||||
// span: columns, | |||||
// modalType: modalType, | |||||
// }, | |||||
// nzOnCancel: (): void => {}, | |||||
// nzOnOk: (EventEmitter: any): Boolean => { | |||||
// switch (type) { | |||||
// case 1: // 设置责任人 | |||||
// this.settingPerson(); | |||||
// break; | |||||
// case 2: // 加派辅助 | |||||
// this.settingDispatch(); | |||||
// break; | |||||
// } | |||||
// // this.change.emit({ | |||||
// // type: 'application-submit', | |||||
// // }); | |||||
// // this.changeRef.markForCheck(); | |||||
// return true; | |||||
// }, | |||||
// }); | |||||
// } else if (this.have_person === false && this.occupied_state === '2') { | |||||
// // 情况3:不存在负责人并且当前人员不空闲,则先选择优先级 | |||||
// const model = this.openPriorityModal(8, 'form-modal', type); | |||||
// } else if (this.have_person === false && this.occupied_state !== '2') { | |||||
// // 情况4: 不存在负责人并且当前人员不被占用 | |||||
// // 直接调用设置负责人的接口 | |||||
// switch (type) { | |||||
// case 1: // 设置责任人 | |||||
// this.settingPerson(); | |||||
// break; | |||||
// case 2: // 加派辅助 | |||||
// this.settingDispatch(); | |||||
// break; | |||||
// } | |||||
// } | |||||
} | |||||
openDispatchModal(columns: number, modalType: AthGridModalType, type) { | |||||
if (this.have_person === false) { | |||||
// 不存在责任人 | |||||
return this.modalService.create({ | |||||
nzTitle: '故障尚无处理责任人,请先指定责任人!', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.setPersonTemplateRef1, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
return true; | |||||
}, | |||||
}); | |||||
} else if (this.have_person === true) { | |||||
// 情况1: 存在责任人,且被占用 | |||||
// 当前条目被占用 | |||||
if (this.occupied_state === '2') { | |||||
this.openPriorityModal(8, 'form-modal', type); | |||||
} else { | |||||
// 当前条目未被占用 | |||||
this.settingDispatch(); | |||||
} | |||||
} | |||||
// else if (this.have_person === true && this.occupied_state === '3') { | |||||
// // 情况2:存在负责人且当前人员空闲,是否替换责任人 | |||||
// return this.modalService.create({ | |||||
// nzTitle: '故障已指定责任人,是否更换责任人?', | |||||
// nzWrapClassName: 'ath-grid-modal-wrap', | |||||
// nzContent: this.setPersonTemplateRef, | |||||
// nzComponentParams: { | |||||
// span: columns, | |||||
// modalType: modalType, | |||||
// }, | |||||
// gridConfig: { | |||||
// span: columns, | |||||
// modalType: modalType, | |||||
// }, | |||||
// nzOnCancel: (): void => {}, | |||||
// nzOnOk: (EventEmitter: any): Boolean => { | |||||
// switch (type) { | |||||
// case 1: // 设置责任人 | |||||
// this.settingPerson(); | |||||
// break; | |||||
// case 2: // 加派辅助 | |||||
// this.settingDispatch(); | |||||
// break; | |||||
// } | |||||
// // this.change.emit({ | |||||
// // type: 'application-submit', | |||||
// // }); | |||||
// // this.changeRef.markForCheck(); | |||||
// return true; | |||||
// }, | |||||
// }); | |||||
// } else if (this.have_person === false && this.occupied_state === '2') { | |||||
// // 情况3:不存在负责人并且当前人员不空闲,则先选择优先级 | |||||
// const model = this.openPriorityModal(8, 'form-modal', type); | |||||
// } else if (this.have_person === false && this.occupied_state !== '2') { | |||||
// // 情况4: 不存在负责人并且当前人员不被占用 | |||||
// // 直接调用设置负责人的接口 | |||||
// switch (type) { | |||||
// case 1: // 设置责任人 | |||||
// this.settingPerson(); | |||||
// break; | |||||
// case 2: // 加派辅助 | |||||
// this.settingDispatch(); | |||||
// break; | |||||
// } | |||||
// } | |||||
} | |||||
openPriorityModal(columns: number, modalType: AthGridModalType, type) { | |||||
const model = this.modalService.create({ | |||||
nzTitle: '该人员目前正在执行其他任务,请确认优先级!', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.priorityTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzFooter: [ | |||||
{ | |||||
label: '原任务优先', // 按钮文本 | |||||
type: 'primary', | |||||
onClick: (e) => { | |||||
this.priority_type = '1'; | |||||
switch (type) { | |||||
case 1: | |||||
// 设置责任人 | |||||
this.settingPerson(); | |||||
break; | |||||
case 2: | |||||
// 加派辅助 | |||||
this.settingDispatch(); | |||||
break; | |||||
} | |||||
model.close(); | |||||
// this.modalService.closeAll(); | |||||
// this.change.emit({ | |||||
// type: 'application-submit', | |||||
// }); | |||||
// this.changeRef.markForCheck(); | |||||
}, | |||||
}, | |||||
{ | |||||
label: '当前任务优先', // 按钮文本 | |||||
type: 'primary', | |||||
onClick: (e) => { | |||||
this.priority_type = '2'; | |||||
switch (type) { | |||||
case 1: | |||||
this.settingPerson(); | |||||
break; | |||||
case 2: | |||||
this.settingDispatch(); | |||||
break; | |||||
} | |||||
// this.modalService.closeAll(); | |||||
// this.change.emit({ | |||||
// type: 'application-submit', | |||||
// }); | |||||
// this.changeRef.markForCheck(); | |||||
model.close(); | |||||
}, | |||||
}, | |||||
{ | |||||
label: '返回重新选择', // 按钮文本 | |||||
type: 'primary', | |||||
onClick: (e) => { | |||||
this.priority_type = ''; | |||||
model.close(); | |||||
}, | |||||
}, | |||||
], | |||||
}); | |||||
return model; | |||||
} | |||||
/** | |||||
* 调用设置负责人的接口 | |||||
*/ | |||||
settingPerson() { | |||||
// // 调用更换责任人的接口。TODO需调整入参,传入任务卡当前条目的全部数据 | |||||
const charge_info = [ | |||||
{ | |||||
id: this.group.get('id').value || '', | |||||
eoc_no: this.group.get('eoc_no').value, | |||||
eoc_name: this.group.get('eoc_name').value, | |||||
priority: this.priority_type, | |||||
is_responsible: this.have_person, | |||||
equipment_fault_info: this.equipment_fault_info, | |||||
activity_backLog_datas: | |||||
this.equipment_fault_info.activity__backLog__data, | |||||
}, | |||||
]; | |||||
this.settingBtnService | |||||
.ca_efm_set_charge_info_process(charge_info) | |||||
.then((res) => { | |||||
this.commonService.messageSource.next(true); | |||||
// 更新数据,是否重新调用get接口 | |||||
// this.getTableList(); | |||||
}); | |||||
} | |||||
/** | |||||
* 调用加派辅助的接口 | |||||
*/ | |||||
settingDispatch() { | |||||
// // 调用加派辅助的接口 | |||||
const charge_info = [ | |||||
{ | |||||
id: this.group.get('id').value || '', | |||||
eoc_no: this.group.get('eoc_no').value, | |||||
eoc_name: this.group.get('eoc_name').value, | |||||
priority: this.priority_type, | |||||
is_responsible: this.have_person, | |||||
equipment_fault_info: this.equipment_fault_info, | |||||
activity_backLog_datas: | |||||
this.equipment_fault_info.activity__backLog__data, | |||||
}, | |||||
]; | |||||
this.settingBtnService | |||||
.ca_efm_add_dispat_info_process(charge_info) | |||||
.then((res) => { | |||||
this.commonService.messageSource.next(true); | |||||
// 更新数据,是否重新调用get接口 | |||||
}); | |||||
} | |||||
// 撤回 | |||||
openWithDrawModal(columns: number, modalType: AthGridModalType) { | |||||
return this.modalService.create({ | |||||
nzTitle: '确认撤回?', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.withDrawTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
const revocation_info = [ | |||||
{ | |||||
id: this.group.get('id').value, | |||||
}, | |||||
]; | |||||
this.settingBtnService | |||||
.ca_efm_revocation_info_process(revocation_info) | |||||
.then((res) => { | |||||
this.commonService.messageSource.next(true); | |||||
// if (res) { | |||||
// // 重新调用get | |||||
// const trans_task_info = [ | |||||
// { | |||||
// equipment_fault_info_id: this.group.get( | |||||
// 'equipment_fault_info_id' | |||||
// ).value, | |||||
// }, | |||||
// ]; | |||||
// this.settingBtnService | |||||
// .ca_efm_trans_task_info_get(trans_task_info) | |||||
// .then((res) => { | |||||
// // 获取表格数据,更新表格数据 | |||||
// // this.tableList = res; | |||||
// }); | |||||
// } | |||||
}); | |||||
return true; | |||||
}, | |||||
}); | |||||
} | |||||
/** | |||||
* 获取列表 | |||||
*/ | |||||
getTableList() { | |||||
const trans_task_info = [ | |||||
{ | |||||
equipment_fault_info_id: this.equipment_fault_info.id, | |||||
}, | |||||
]; | |||||
this.settingBtnService | |||||
.ca_efm_trans_task_info_get(trans_task_info) | |||||
.then((res) => { | |||||
// console.log('tableList', this.tableList); | |||||
// this.group.parent.setTableData([]) | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { SettingBtnComponent } from './setting-btn.component'; | |||||
@NgModule({ | |||||
declarations: [ SettingBtnComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class SettingBtnModule {} |
@ -0,0 +1,104 @@ | |||||
import { HttpClient } from '@angular/common/http'; | |||||
import { Injectable } from '@angular/core'; | |||||
import { TranslateService } from '@ngx-translate/core'; | |||||
import { DwSystemConfigService } from '@webdpt/framework'; | |||||
import { CommonService } from '../../../service/common.service'; | |||||
@Injectable() | |||||
export class SettingBtnService { | |||||
atdmUrl: string; | |||||
eocUrl: string; | |||||
uibotUrl: string; | |||||
smartDataUrl: string; | |||||
content: any; | |||||
executeContext: any; | |||||
isLoadStatus: boolean = true; | |||||
constructor( | |||||
private http: HttpClient, | |||||
private configService: DwSystemConfigService, | |||||
private commonService: CommonService, | |||||
private translateService: TranslateService | |||||
) { | |||||
this.configService.get('atdmUrl').subscribe((url: string) => { | |||||
this.atdmUrl = url; | |||||
}); | |||||
this.configService.get('eocUrl').subscribe((url: string): void => { | |||||
this.eocUrl = url; | |||||
}); | |||||
this.configService.get('uibotUrl').subscribe((url: string): void => { | |||||
this.uibotUrl = url; | |||||
}); | |||||
this.configService.get('smartDataUrl').subscribe((url: string) => { | |||||
this.smartDataUrl = url; | |||||
}); | |||||
} | |||||
/** | |||||
* 这是一个请求示例,可以自行修改或删除 | |||||
*/ | |||||
demo_api_data_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('item.supply.demand.data.get', { | |||||
query_condition: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.demand_data); | |||||
}); | |||||
}); | |||||
} | |||||
// 撤回 | |||||
ca_efm_revocation_info_process(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.revocation.info.process', { | |||||
revocation_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res); | |||||
}); | |||||
}); | |||||
} | |||||
/** | |||||
* 加派ca.efm.revocation.info.process | |||||
*/ | |||||
ca_efm_add_dispat_info_process(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.add.dispat.info.process', { | |||||
charge_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res); | |||||
}); | |||||
}); | |||||
} | |||||
/** | |||||
* 设置责任人 ca.efm.revocation.info.process | |||||
*/ | |||||
ca_efm_set_charge_info_process(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.set.charge.info.process', { | |||||
charge_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res); | |||||
}); | |||||
}); | |||||
} | |||||
/** | |||||
* 设备清单get接口 | |||||
*/ | |||||
ca_efm_trans_task_info_get(params: any): Promise<any> { | |||||
return new Promise((resolve, reject): void => { | |||||
this.commonService | |||||
.getInvData('ca.efm.trans.task.info.get', { | |||||
trans_task_info: params, | |||||
}) | |||||
.subscribe((res): void => { | |||||
resolve(res.data.trans_task_info); | |||||
}); | |||||
}); | |||||
} | |||||
} |
@ -0,0 +1,16 @@ | |||||
<div class="time-expand"> | |||||
<div> | |||||
{{group.get('plan_process_time').value}} | |||||
</div> | |||||
<button [disabled]="finished || pageCode==='project-detail'" ath-button athType="cell-link" (click)="openModal(8, 'form-modal')"> | |||||
延长预计时长 | |||||
</button> | |||||
<ng-template #timeExpandTemplateRef> | |||||
选择时间:<ath-date-picker | |||||
[(ngModel)]="start_time" | |||||
(ngModelChange)="onChange($event)" | |||||
nzFormat="yyyy/MM/dd HH:mm:ss" | |||||
[nzShowTime]="showTimeFormat" | |||||
></ath-date-picker> | |||||
</ng-template> | |||||
</div> |
@ -0,0 +1,3 @@ | |||||
.time-expand{ | |||||
} |
@ -0,0 +1,106 @@ | |||||
import { | |||||
ChangeDetectorRef, | |||||
Component, | |||||
ElementRef, | |||||
EventEmitter, | |||||
Input, | |||||
OnInit, | |||||
Output, | |||||
TemplateRef, | |||||
ViewChild, | |||||
} from '@angular/core'; | |||||
import { FormGroup } from '@angular/forms'; | |||||
// eslint-disable-next-line max-len | |||||
import { | |||||
DynamicFormControlComponent, | |||||
DynamicFormControlLayout, | |||||
DynamicFormLayout, | |||||
DynamicFormLayoutService, | |||||
DynamicFormValidationService, | |||||
} from '@athena/dynamic-core'; | |||||
import { DynamicTimeExpandModel } from 'app/implementation/model/time-expand/time-expand.model'; | |||||
import { TimeExpandService } from './time-expand.service'; | |||||
import { CommonService } from 'app/implementation/service/common.service'; | |||||
import { AthGridModalType } from '@athena/design-ui/components/modal/modal-types'; | |||||
import { AthModalService } from '@athena/design-ui/src/components/modal'; | |||||
@Component({ | |||||
selector: 'app-time-expand', | |||||
templateUrl: './time-expand.component.html', | |||||
styleUrls: ['./time-expand.component.less'], | |||||
providers: [TimeExpandService, CommonService], | |||||
}) | |||||
export class TimeExpandComponent | |||||
extends DynamicFormControlComponent | |||||
implements OnInit | |||||
{ | |||||
@Input() formLayout: DynamicFormLayout; | |||||
@Input() group: FormGroup; | |||||
@Input() layout: DynamicFormControlLayout; | |||||
@Input() model: DynamicTimeExpandModel; | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() blur: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() change: EventEmitter<any> = new EventEmitter(); | |||||
// eslint-disable-next-line @angular-eslint/no-output-native | |||||
@Output() focus: EventEmitter<any> = new EventEmitter(); | |||||
@ViewChild('timeExpandTemplateRef') timeExpandTemplateRef: TemplateRef<any>; | |||||
start_time: any; | |||||
showTimeFormat = { nzFormat: 'HH:mm:ss' }; | |||||
finished: any; | |||||
pageCode: any; | |||||
constructor( | |||||
protected changeRef: ChangeDetectorRef, | |||||
protected layoutService: DynamicFormLayoutService, | |||||
protected validationService: DynamicFormValidationService, | |||||
protected elementRef: ElementRef, | |||||
private timeExpandService: TimeExpandService, | |||||
public commonService: CommonService, | |||||
public modalService: AthModalService | |||||
) { | |||||
super(layoutService, validationService, changeRef, elementRef); | |||||
} | |||||
ngOnInit() { | |||||
this.commonService.content = this.model.content; | |||||
this.finished = this.commonService.content.finished; | |||||
this.pageCode = this.commonService.content.pageCode; | |||||
} | |||||
openModal(columns: number, modalType: AthGridModalType) { | |||||
this.start_time = null; | |||||
return this.modalService.create({ | |||||
nzTitle: '延长时间', | |||||
nzWrapClassName: 'ath-grid-modal-wrap', | |||||
nzContent: this.timeExpandTemplateRef, | |||||
nzComponentParams: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
gridConfig: { | |||||
span: columns, | |||||
modalType: modalType, | |||||
}, | |||||
nzOnCancel: (): void => {}, | |||||
// eslint-disable-next-line no-shadow | |||||
nzOnOk: (EventEmitter: any): Boolean => { | |||||
// console.log('timeExpandTemplateRef', EventEmitter); | |||||
const extend_info = [ | |||||
{ | |||||
id: this.group.get('id').value, | |||||
start_time: this.start_time, | |||||
// equipment_fault_info: this.group.value, | |||||
}, | |||||
]; | |||||
// TODO 需调整入参,需传入任务卡当前条目的完整数据 | |||||
this.timeExpandService | |||||
.ca_efm_extend_time_info_process(extend_info) | |||||
.then((res) => {}); | |||||
this.change.emit({ | |||||
type: 'application-submit', | |||||
}); | |||||
this.changeRef.markForCheck(); | |||||
return true; | |||||
}, | |||||
}); | |||||
} | |||||
onChange(event) {} | |||||
} |
@ -0,0 +1,13 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { CommonModule } from '@angular/common'; | |||||
import { CustSharedModule } from '../../../shared/cust-shared.module'; | |||||
import { TimeExpandComponent } from './time-expand.component'; | |||||
@NgModule({ | |||||
declarations: [ TimeExpandComponent ], | |||||
imports: [ | |||||
CommonModule, | |||||
CustSharedModule, | |||||
], | |||||
}) | |||||
export class TimeExpandModule {} |