diff --git a/efm-demo-web/.microsite/.browserslistrc b/efm-demo-web/.microsite/.browserslistrc new file mode 100644 index 0000000..427441d --- /dev/null +++ b/efm-demo-web/.microsite/.browserslistrc @@ -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. diff --git a/efm-demo-web/.microsite/.npmrc b/efm-demo-web/.microsite/.npmrc new file mode 100644 index 0000000..9ae05fc --- /dev/null +++ b/efm-demo-web/.microsite/.npmrc @@ -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 \ No newline at end of file diff --git a/efm-demo-web/.microsite/angular.json b/efm-demo-web/.microsite/angular.json new file mode 100644 index 0000000..9d920a5 --- /dev/null +++ b/efm-demo-web/.microsite/angular.json @@ -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" +} \ No newline at end of file diff --git a/efm-demo-web/.microsite/package.json b/efm-demo-web/.microsite/package.json new file mode 100644 index 0000000..6921c8b --- /dev/null +++ b/efm-demo-web/.microsite/package.json @@ -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" + } +} diff --git a/efm-demo-web/.microsite/proxy.conf.js b/efm-demo-web/.microsite/proxy.conf.js new file mode 100644 index 0000000..decb2e5 --- /dev/null +++ b/efm-demo-web/.microsite/proxy.conf.js @@ -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 + } +}; \ No newline at end of file diff --git a/efm-demo-web/.microsite/src/bootstrap.ts b/efm-demo-web/.microsite/src/bootstrap.ts new file mode 100644 index 0000000..9a13768 --- /dev/null +++ b/efm-demo-web/.microsite/src/bootstrap.ts @@ -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)); +}); + + diff --git a/efm-demo-web/.microsite/src/environments/environment.prod.ts b/efm-demo-web/.microsite/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/efm-demo-web/.microsite/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/efm-demo-web/.microsite/src/environments/environment.ts b/efm-demo-web/.microsite/src/environments/environment.ts new file mode 100644 index 0000000..f56ff47 --- /dev/null +++ b/efm-demo-web/.microsite/src/environments/environment.ts @@ -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. diff --git a/efm-demo-web/.microsite/src/index.html b/efm-demo-web/.microsite/src/index.html new file mode 100644 index 0000000..f996e2c --- /dev/null +++ b/efm-demo-web/.microsite/src/index.html @@ -0,0 +1,15 @@ + + + + + 鼎捷雅典娜 + + + + + + + + + + diff --git a/efm-demo-web/.microsite/src/main.ts b/efm-demo-web/.microsite/src/main.ts new file mode 100644 index 0000000..ddbb88f --- /dev/null +++ b/efm-demo-web/.microsite/src/main.ts @@ -0,0 +1,2 @@ +import('./bootstrap') + .catch(err => console.error(err)); diff --git a/efm-demo-web/.microsite/src/polyfills.ts b/efm-demo-web/.microsite/src/polyfills.ts new file mode 100644 index 0000000..ab82666 --- /dev/null +++ b/efm-demo-web/.microsite/src/polyfills.ts @@ -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'; diff --git a/efm-demo-web/.microsite/src/static/.version b/efm-demo-web/.microsite/src/static/.version new file mode 100644 index 0000000..76a57fa --- /dev/null +++ b/efm-demo-web/.microsite/src/static/.version @@ -0,0 +1 @@ +1736933834241 \ No newline at end of file diff --git a/efm-demo-web/.microsite/src/static/api.dev.json b/efm-demo-web/.microsite/src/static/api.dev.json new file mode 100644 index 0000000..85c2253 --- /dev/null +++ b/efm-demo-web/.microsite/src/static/api.dev.json @@ -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" +} \ No newline at end of file diff --git a/efm-demo-web/.microsite/src/static/download/.gitkeep b/efm-demo-web/.microsite/src/static/download/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/.microsite/src/static/download/api.json b/efm-demo-web/.microsite/src/static/download/api.json new file mode 100644 index 0000000..4a99952 --- /dev/null +++ b/efm-demo-web/.microsite/src/static/download/api.json @@ -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" +} diff --git a/efm-demo-web/.microsite/src/static/download/plugins-config-server.json b/efm-demo-web/.microsite/src/static/download/plugins-config-server.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/efm-demo-web/.microsite/src/static/download/plugins-config-server.json @@ -0,0 +1 @@ +{} diff --git a/efm-demo-web/.microsite/src/static/package/plugins-config-server.json b/efm-demo-web/.microsite/src/static/package/plugins-config-server.json new file mode 100644 index 0000000..4a4ad3a --- /dev/null +++ b/efm-demo-web/.microsite/src/static/package/plugins-config-server.json @@ -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" + } + } +} \ No newline at end of file diff --git a/efm-demo-web/.microsite/src/static/remote-host.json b/efm-demo-web/.microsite/src/static/remote-host.json new file mode 100644 index 0000000..c22d864 --- /dev/null +++ b/efm-demo-web/.microsite/src/static/remote-host.json @@ -0,0 +1 @@ +{"host":"https://athena-test.digiwincloud.com.cn"} \ No newline at end of file diff --git a/efm-demo-web/.microsite/src/styles.less b/efm-demo-web/.microsite/src/styles.less new file mode 100644 index 0000000..588904b --- /dev/null +++ b/efm-demo-web/.microsite/src/styles.less @@ -0,0 +1,4 @@ +/* You can add global styles to this file, and also import other style files */ +body{ + background-color: #f5f5f5; +} diff --git a/efm-demo-web/.microsite/src/test.ts b/efm-demo-web/.microsite/src/test.ts new file mode 100644 index 0000000..d3a6c0b --- /dev/null +++ b/efm-demo-web/.microsite/src/test.ts @@ -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[]; + (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); diff --git a/efm-demo-web/.microsite/tsconfig.app.json b/efm-demo-web/.microsite/tsconfig.app.json new file mode 100644 index 0000000..82d91dc --- /dev/null +++ b/efm-demo-web/.microsite/tsconfig.app.json @@ -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" + ] +} diff --git a/efm-demo-web/.microsite/tsconfig.json b/efm-demo-web/.microsite/tsconfig.json new file mode 100644 index 0000000..9e9e682 --- /dev/null +++ b/efm-demo-web/.microsite/tsconfig.json @@ -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 + } +} diff --git a/efm-demo-web/.microsite/webpack.config.js b/efm-demo-web/.microsite/webpack.config.js new file mode 100644 index 0000000..f9978af --- /dev/null +++ b/efm-demo-web/.microsite/webpack.config.js @@ -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() + ], +}; diff --git a/efm-demo-web/athena-microsite.config.js b/efm-demo-web/athena-microsite.config.js index 30677ac..ba2767f 100644 --- a/efm-demo-web/athena-microsite.config.js +++ b/efm-demo-web/athena-microsite.config.js @@ -3,25 +3,23 @@ module.exports = { envHosts: { paas: 'https://athena-paas.digiwincloud.com.cn', test: 'https://athena-test.digiwincloud.com.cn', - prod: 'https://athena.digiwincloud.com.cn' - }, - apiJson: { - + prod: 'https://athena.digiwincloud.com.cn', }, + apiJson: {}, pluginsConfigServer: { - "app": { - "efm-demoAT": { - "name": "efmdemoAT", - "urlPrefixType": "", - "root": "http://localhost:4200", - "path": "EfmDemoATModule.js", - "description": "", - "i18n": true, - "disabledMultiVersion": true, - "isMF": true, - "moduleName": "EfmDemoATModule", - "exposesPath": "./efm-demoAT" - } - } - } + 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', + }, + }, + }, }; diff --git a/efm-demo-web/package.json b/efm-demo-web/package.json index 3c4e8fe..49284a7 100644 --- a/efm-demo-web/package.json +++ b/efm-demo-web/package.json @@ -152,4 +152,4 @@ "@webdpt/athena-microsite": "5.2.11-1000", "@athena/platform-devkit": "1.0.0-4" } -} \ No newline at end of file +} diff --git a/efm-demo-web/src/app/config/custom-app-config.ts b/efm-demo-web/src/app/config/custom-app-config.ts index d8bb0ea..124be70 100644 --- a/efm-demo-web/src/app/config/custom-app-config.ts +++ b/efm-demo-web/src/app/config/custom-app-config.ts @@ -26,4 +26,49 @@ export const CUSTOM_APP_CONFIG: ICustomAppConfig = { }; /** 定制页信息 */ -export const programs: IProgramInfo = {}; +export const programs: IProgramInfo = { + knowledgeBase: { + jsonPath: '/assets/api/api-knowledge-base.json', + description: '查询知识库' + }, + faultDetailBtn: { + jsonPath: '/assets/api/api-fault-detail-btn.json', + description: '故障统计明细' + }, + faultCount: { + jsonPath: '/assets/api/api-fault-count.json', + description: '故障统计' + }, + timeExpand: { + jsonPath: '/assets/api/api-time-expand.json', + description: '延长时间' + }, + settingBtn: { + jsonPath: '/assets/api/api-setting-btn.json', + description: '派遣清单操作列' + }, + dispatchList: { + jsonPath: '/assets/api/api-dispatch-list.json', + description: '派遣清单' + }, + deviceDetail: { + jsonPath: '/assets/api/api-device-detail.json', + description: '设备详情' + }, + productPlan: { + jsonPath: '/assets/api/api-product-plan.json', + description: '生产计划' + }, + workOrderEffect: { + jsonPath: '/assets/api/api-work-order-effect.json', + description: '当前工单影响' + }, + faultPlanOperateFiled: { + jsonPath: '/assets/api/api-fault-plan-operate-filed.json', + description: '故障预案操作栏位' + }, + faultPlanAddRow: { + jsonPath: '/assets/api/api-fault-plan-add-row.json', + description: '故障预案基础资料新增' + } +}; diff --git a/efm-demo-web/src/app/implementation/model/device-detail/device-detail.model.ts b/efm-demo-web/src/app/implementation/model/device-detail/device-detail.model.ts new file mode 100644 index 0000000..27525f9 --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/device-detail/device-detail.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/dispatch-list/dispatch-list.model.ts b/efm-demo-web/src/app/implementation/model/dispatch-list/dispatch-list.model.ts new file mode 100644 index 0000000..65987aa --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/dispatch-list/dispatch-list.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/fault-count/fault-count.model.ts b/efm-demo-web/src/app/implementation/model/fault-count/fault-count.model.ts new file mode 100644 index 0000000..ad5cd54 --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/fault-count/fault-count.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/fault-detail-btn/fault-detail-btn.model.ts b/efm-demo-web/src/app/implementation/model/fault-detail-btn/fault-detail-btn.model.ts new file mode 100644 index 0000000..f794ba4 --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/fault-detail-btn/fault-detail-btn.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/fault-plan-add-row/fault-plan-add-row.model.ts b/efm-demo-web/src/app/implementation/model/fault-plan-add-row/fault-plan-add-row.model.ts new file mode 100644 index 0000000..fd5af3b --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/fault-plan-add-row/fault-plan-add-row.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/fault-plan-operate-filed/fault-plan-operate-filed.model.ts b/efm-demo-web/src/app/implementation/model/fault-plan-operate-filed/fault-plan-operate-filed.model.ts new file mode 100644 index 0000000..4616b7b --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/fault-plan-operate-filed/fault-plan-operate-filed.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/knowledge-base/knowledge-base.model.ts b/efm-demo-web/src/app/implementation/model/knowledge-base/knowledge-base.model.ts new file mode 100644 index 0000000..a19737d --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/knowledge-base/knowledge-base.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/product-plan/product-plan.model.ts b/efm-demo-web/src/app/implementation/model/product-plan/product-plan.model.ts new file mode 100644 index 0000000..c9d8e9c --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/product-plan/product-plan.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/setting-btn/setting-btn.model.ts b/efm-demo-web/src/app/implementation/model/setting-btn/setting-btn.model.ts new file mode 100644 index 0000000..35eaf2e --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/setting-btn/setting-btn.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/time-expand/time-expand.model.ts b/efm-demo-web/src/app/implementation/model/time-expand/time-expand.model.ts new file mode 100644 index 0000000..5c38c95 --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/time-expand/time-expand.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/model/work-order-effect/work-order-effect.model.ts b/efm-demo-web/src/app/implementation/model/work-order-effect/work-order-effect.model.ts new file mode 100644 index 0000000..6ce6226 --- /dev/null +++ b/efm-demo-web/src/app/implementation/model/work-order-effect/work-order-effect.model.ts @@ -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 { + @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; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/basic-detail.module.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/basic-detail.module.ts index 80c6ea0..1e5ac47 100644 --- a/efm-demo-web/src/app/implementation/programs/basic-detail/basic-detail.module.ts +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/basic-detail.module.ts @@ -1,10 +1,12 @@ import { NgModule } from '@angular/core'; 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({ imports: [CommonModule, ...programsModules], declarations: [], }) -export class BasicDetailModule {} +export class BasicDetailModule { } diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.html b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.html new file mode 100644 index 0000000..e2e5329 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.less b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.less new file mode 100644 index 0000000..4f39605 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.less @@ -0,0 +1,3 @@ +.fault-plan-add-row{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.ts new file mode 100644 index 0000000..6b6928f --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = 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); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.module.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.module.ts new file mode 100644 index 0000000..edc2ccb --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.service.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.service.ts new file mode 100644 index 0000000..6b6d23c --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-add-row/fault-plan-add-row.service.ts @@ -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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.html b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.html new file mode 100644 index 0000000..ffcad68 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.html @@ -0,0 +1,5 @@ +
+ 上移 + 下移 + 删除 +
diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.less b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.less new file mode 100644 index 0000000..169b12c --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.less @@ -0,0 +1,7 @@ +.fault-plan-operate-filed { + .opreate-btn { + color: blue; + padding-right: 10px; + cursor: pointer; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.ts new file mode 100644 index 0000000..d1efa14 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = 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(); + } + } +} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.module.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.module.ts new file mode 100644 index 0000000..d708629 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.service.ts b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.service.ts new file mode 100644 index 0000000..f477493 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.service.ts @@ -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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.html new file mode 100644 index 0000000..3a50d32 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.html @@ -0,0 +1,47 @@ +
+
+ 正常 + + + 停机 +
+ + +
+ + 故障设备:{{classification_name}} - {{equipment_name}} + + + 车间:{{workshop}} - {{product_line}} + +
+ + + + + + + + + +
+
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.less new file mode 100644 index 0000000..c790893 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.less @@ -0,0 +1,3 @@ +.device-detail{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.ts new file mode 100644 index 0000000..55973ef --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('deviceDetailTemplateRef') + deviceDetailTemplateRef: TemplateRef; + 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; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.module.ts new file mode 100644 index 0000000..7a41cf7 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.service.ts new file mode 100644 index 0000000..05a9c95 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/device-detail/device-detail.service.ts @@ -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 { + 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 { + 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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/column.ts b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/column.ts new file mode 100644 index 0000000..3766010 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/column.ts @@ -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, + }, +]; diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.html new file mode 100644 index 0000000..8958ff2 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.html @@ -0,0 +1,22 @@ +
+
+ {{group.get('employee_name_responsible').value}} +
+
+ {{group.get('employee_no_responsible').value}} +
+ + +
+
+
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.less new file mode 100644 index 0000000..c6c7843 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.less @@ -0,0 +1,3 @@ +.dispatch-list{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.ts new file mode 100644 index 0000000..3cff0fb --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('dispatchListTemplateRef') + dispatchListTemplateRef: TemplateRef; + 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; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.module.ts new file mode 100644 index 0000000..1f3a393 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.service.ts new file mode 100644 index 0000000..7c797a6 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/dispatch-list/dispatch-list.service.ts @@ -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 { + 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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/column.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/column.ts new file mode 100644 index 0000000..b62dcf2 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/column.ts @@ -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, + }, +]; diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.html new file mode 100644 index 0000000..ef2c0d8 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.html @@ -0,0 +1,20 @@ +
+

{{group.get('equipment_model').value}}

+

{{group.get('equipment_name').value}}

+ + + 设备90天内主要故障统计 +
+
+
+
+
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.less new file mode 100644 index 0000000..826660e --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.less @@ -0,0 +1,3 @@ +.fault-count{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.ts new file mode 100644 index 0000000..84248ef --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('faultCountTemplateRef') faultCountTemplateRef: TemplateRef; + 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, + }; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.module.ts new file mode 100644 index 0000000..eac803e --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.service.ts new file mode 100644 index 0000000..6cc8f9e --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-count/fault-count.service.ts @@ -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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.html new file mode 100644 index 0000000..965973c --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.html @@ -0,0 +1,13 @@ +
+ + + + +
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.less new file mode 100644 index 0000000..ff2c882 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.less @@ -0,0 +1,3 @@ +.fault-detail-btn{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.ts new file mode 100644 index 0000000..77e01d7 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('faultDetailTemplateRef') faultDetailTemplateRef: TemplateRef; + 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), + }; + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.module.ts new file mode 100644 index 0000000..5c9dc60 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.service.ts new file mode 100644 index 0000000..cf1afed --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/fault-detail-btn/fault-detail-btn.service.ts @@ -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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.html new file mode 100644 index 0000000..b56c4a8 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.html @@ -0,0 +1,42 @@ +
+ + +
+ 设备:{{equipment_model}} - {{equipment_name}} + 故障类别:{{fault_category_name}} + 故障码:{{fault_code}} +
+ + + + + + + +
+
+ +
+
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.less new file mode 100644 index 0000000..a4186f3 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.less @@ -0,0 +1,3 @@ +.knowledge-base{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.ts new file mode 100644 index 0000000..246f4cc --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('knowledgeTemplateRef') knowledgeTemplateRef: TemplateRef; + 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); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.module.ts new file mode 100644 index 0000000..9c70bfd --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.service.ts new file mode 100644 index 0000000..5368434 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/knowledge-base/knowledge-base.service.ts @@ -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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.html new file mode 100644 index 0000000..7e3a0f8 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.html @@ -0,0 +1,6 @@ +
+ + +
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.less new file mode 100644 index 0000000..a390688 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.less @@ -0,0 +1,3 @@ +.product-plan{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.ts new file mode 100644 index 0000000..5fe0bb0 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('athenaTable', { static: true }) athenaTable: AthTableComponent; + @ViewChild('productPlanTemplateRef') productPlanTemplateRef: TemplateRef; + 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(); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.module.ts new file mode 100644 index 0000000..c331ce3 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.service.ts new file mode 100644 index 0000000..07053c7 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/product-plan/product-plan.service.ts @@ -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; + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.html new file mode 100644 index 0000000..117735d --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.html @@ -0,0 +1,25 @@ +
+ 设置负责人 + 加派辅助 + 撤回 + + + + + + + + + + + + + + + + + + + + +
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.less new file mode 100644 index 0000000..f18f496 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.less @@ -0,0 +1,9 @@ +.setting-btn { + .btn-box { + color: blue; + padding-right: 15px; + cursor: pointer; + } + .withdraw-box { + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.ts new file mode 100644 index 0000000..d65fdba --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + // 设置负责人 + @ViewChild('setPersonTemplateRef') setPersonTemplateRef: TemplateRef; + @ViewChild('setPersonTemplateRef1') setPersonTemplateRef1: TemplateRef; + // occupiedTemplateRef 加派 + @ViewChild('occupiedTemplateRef') occupiedTemplateRef: TemplateRef; + // withDrawTemplateRef 撤回 + @ViewChild('withDrawTemplateRef') withDrawTemplateRef: TemplateRef; + // priorityTemplateRef + @ViewChild('priorityTemplateRef') priorityTemplateRef: TemplateRef; + 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([]) + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.module.ts new file mode 100644 index 0000000..9bc8bd0 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.service.ts new file mode 100644 index 0000000..84d21e7 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/setting-btn/setting-btn.service.ts @@ -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 { + 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 { + 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 { + 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 { + 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 { + 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); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/task-detail.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/task-detail.module.ts index 4d99dbc..8bf1d54 100644 --- a/efm-demo-web/src/app/implementation/programs/task-detail/task-detail.module.ts +++ b/efm-demo-web/src/app/implementation/programs/task-detail/task-detail.module.ts @@ -1,8 +1,25 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { WorkOrderEffectModule } from './work-order-effect/work-order-effect.module'; +import { ProductPlanModule } from './product-plan/product-plan.module'; +import { DeviceDetailModule } from './device-detail/device-detail.module'; +import { DispatchListModule } from './dispatch-list/dispatch-list.module'; +import { SettingBtnModule } from './setting-btn/setting-btn.module'; +import { TimeExpandModule } from './time-expand/time-expand.module'; +import { FaultCountModule } from './fault-count/fault-count.module'; +import { FaultDetailBtnModule } from './fault-detail-btn/fault-detail-btn.module'; +import { KnowledgeBaseModule } from './knowledge-base/knowledge-base.module'; const programsModules = [ - + WorkOrderEffectModule, + ProductPlanModule, + DeviceDetailModule, + DispatchListModule, + SettingBtnModule, + TimeExpandModule, + FaultCountModule, + FaultDetailBtnModule, + KnowledgeBaseModule ]; @NgModule({ diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.html new file mode 100644 index 0000000..2b54cd3 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.html @@ -0,0 +1,16 @@ +
+
+ {{group.get('plan_process_time').value}} +
+ + + 选择时间: + +
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.less new file mode 100644 index 0000000..c6f98dd --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.less @@ -0,0 +1,3 @@ +.time-expand{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.ts new file mode 100644 index 0000000..30d832a --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.component.ts @@ -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 = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('timeExpandTemplateRef') timeExpandTemplateRef: TemplateRef; + 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) {} +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.module.ts new file mode 100644 index 0000000..6c31b21 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.module.ts @@ -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 {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.service.ts new file mode 100644 index 0000000..ea45e97 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/time-expand/time-expand.service.ts @@ -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 TimeExpandService { + 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 { + 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_extend_time_info_process(params: any): Promise { + return new Promise((resolve, reject): void => { + this.commonService + .getInvData('ca.efm.extend.time.info.process', { + extend_info: params, + }) + .subscribe((res): void => { + resolve(res.data.extend_info); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/column.ts b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/column.ts new file mode 100644 index 0000000..76ce585 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/column.ts @@ -0,0 +1,192 @@ +/* eslint-disable quotes */ +export default [ + { + headerName: '来源', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'source', + headerName: '来源', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'string', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '单号', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'order_no', + headerName: '单号', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'string', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '客户', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'customer_name', + headerName: '客户', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'string', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '成品品项', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'item_name', + headerName: '成品品项', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'string', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '单据数量', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'order_number', + headerName: '单据数量', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'numeric', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '金额', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'price', + headerName: '金额', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'numeric', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, + { + headerName: '客户等级', + path: 'current_mo_info', + level: 0, + description: '', + operations: [], + width: 200, + hide: false, + important: false, + columns: [ + { + type: 'LABEL', + schema: 'level', + headerName: '客户等级', + path: 'current_mo_info', + level: 0, + disabled: false, + editable: true, + dataType: 'string', + sortable: true, + width: 200, + important: false, + }, + ], + headers: [], + isUserDefined: false, + }, +]; diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/components/.gitkeep b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.html b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.html new file mode 100644 index 0000000..7ff36a1 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.html @@ -0,0 +1,56 @@ +
+ + + + +
+
+ + 故障设备:{{classification_name}} - {{equipment_name}} + + + 车间:{{work_shop}} - {{product_line}} + +
+
+ + 当前工单:{{current_mo}} + + + 产品:{{product}} + + + 计划产量:{{plan_qty}} + +
+
+
+
+ +
+ + 故障设备:{{classification_name}} - {{equipment_name}} + + + 车间:{{work_shop}} - {{product_line}} + +
+ +
+
diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.less b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.less new file mode 100644 index 0000000..7d1a29d --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.less @@ -0,0 +1,3 @@ +.work-order-effect{ + +} \ No newline at end of file diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.ts b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.ts new file mode 100644 index 0000000..20a6a36 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.component.ts @@ -0,0 +1,197 @@ +/* eslint-disable no-shadow */ +/* eslint-disable quotes */ +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 { DynamicWorkOrderEffectModel } from 'app/implementation/model/work-order-effect/work-order-effect.model'; +import { WorkOrderEffectService } from './work-order-effect.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'; +import { AthTableComponent } from '@athena/design-ui/src/components/table'; +@Component({ + selector: 'app-work-order-effect', + templateUrl: './work-order-effect.component.html', + styleUrls: ['./work-order-effect.component.less'], + providers: [WorkOrderEffectService, CommonService], +}) +export class WorkOrderEffectComponent + extends DynamicFormControlComponent + implements OnInit +{ + @Input() formLayout: DynamicFormLayout; + @Input() group: FormGroup; + @Input() layout: DynamicFormControlLayout; + @Input() model: DynamicWorkOrderEffectModel; + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() blur: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() change: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() focus: EventEmitter = new EventEmitter(); + @ViewChild('workOrderTemplateRef') workOrderTemplateRef: TemplateRef; + // @ViewChild('athenaTable', { static: true }) athenaTable: AthTableComponent; + @ViewChild('productPlanTemplateRef') productPlanTemplateRef: TemplateRef; + formGroup: FormGroup; + columnDefs: any[] = [ + { headerName: '工单单号', field: 'man_no' }, + { headerName: '品号', field: 'item_no' }, + { headerName: '计划产量', field: 'plan_qty' }, + { headerName: '预计开工时间', field: 'plan_start_time' }, + { headerName: '预计完工时间', field: 'plan_end_time' }, + ]; + tableList = []; + tableOrderList = []; + current_mo: any; + work_shop: any; + product: any; + plan_qty: any; + faulty_equipment: any; + classification_name: any; + equipment_name: any; + product_line: any; + constructor( + protected changeRef: ChangeDetectorRef, + protected layoutService: DynamicFormLayoutService, + protected validationService: DynamicFormValidationService, + protected elementRef: ElementRef, + private workOrderEffectService: WorkOrderEffectService, + 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); + this.classification_name = this.group.get('classification_name').value; + this.equipment_name = this.group.get('equipment_name').value; + this.work_shop = this.group.get('workshop').value; + this.product_line = this.group.get('product_line').value; + } + /** + * 请求当前工单影响接口 + */ + getTableList() { + this.workOrderEffectService.ca_efm_current_mo_info_get({}).then((res) => { + console.log('res111', res); + this.current_mo = res[0].current_mo; // 当前工单 + this.product = res[0].product; // 产品 + this.plan_qty = res[0].plan_qty; // 计划量 + this.tableOrderList = res[0].current_mo_detail; + this.initTable(); + }); + this.workOrderEffectService + .ca_efm_production_plan_info_get({}) + .then((res) => { + this.tableList = res; + // console.log('生产计划', this.tableList); + }); + } + openOrderModal(columns: number, modalType: AthGridModalType) { + this.getTableList(); + return this.modalService.create({ + nzTitle: '当前工单影响', + nzWrapClassName: 'ath-grid-modal-wrap', + nzContent: this.workOrderTemplateRef, + 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: 'current_mo_info', + type: 'ATHENA_TABLE', + editable: true, + disabledUserDefined: true, + schema: 'current_mo_info', + scriptFilters: [], + setting: { + hideDefaultToolbar: ['composite-sort', 'setting'], + }, + columnDefs: this.getColumn(), + allFields: [], + }, + ], + pageData: { + current_mo_info: this.tableOrderList, + }, + rules: [], + content: {}, + style: {}, + }; + return data; + } + getColumn() { + const materialcolums = JSON.parse(JSON.stringify(column)); + const res = materialcolums.map((column) => { + return { + ...column, + }; + }); + return res; + } + + openModal(columns: number, modalType: AthGridModalType) { + return this.modalService.create({ + nzTitle: '后续生产计划', + nzWrapClassName: 'ath-grid-modal-wrap', + nzContent: this.productPlanTemplateRef, + nzComponentParams: { + span: columns, + modalType: modalType, + }, + gridConfig: { + span: columns, + modalType: modalType, + }, + nzOnCancel: (): void => {}, + }); + } +} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.module.ts b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.module.ts new file mode 100644 index 0000000..c022e92 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { CustSharedModule } from '../../../shared/cust-shared.module'; +import { WorkOrderEffectComponent } from './work-order-effect.component'; + +@NgModule({ + declarations: [ WorkOrderEffectComponent ], + imports: [ + CommonModule, + CustSharedModule, + ], +}) +export class WorkOrderEffectModule {} diff --git a/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.service.ts b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.service.ts new file mode 100644 index 0000000..b2bd2a2 --- /dev/null +++ b/efm-demo-web/src/app/implementation/programs/task-detail/work-order-effect/work-order-effect.service.ts @@ -0,0 +1,60 @@ +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 WorkOrderEffectService { + 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; + }); + } + + /** + * 这是一个请求示例,可以自行修改或删除 + */ + ca_efm_current_mo_info_get(params: any): Promise { + return new Promise((resolve, reject): void => { + this.commonService + .getInvData('ca.efm.current.mo.info.get', {}) + .subscribe((res): void => { + resolve(res.data.current_mo_info); + }); + }); + } + /** + * 这是一个请求示例,可以自行修改或删除 + */ + ca_efm_production_plan_info_get(params: any): Promise { + return new Promise((resolve, reject): void => { + this.commonService + .getInvData('ca.efm.production.plan.info.get', {}) + .subscribe((res): void => { + resolve(res.data.production_plan_info); + }); + }); + } +} diff --git a/efm-demo-web/src/app/implementation/service/business-dynamic-component-map.ts b/efm-demo-web/src/app/implementation/service/business-dynamic-component-map.ts index f9eb39c..f6f87a8 100644 --- a/efm-demo-web/src/app/implementation/service/business-dynamic-component-map.ts +++ b/efm-demo-web/src/app/implementation/service/business-dynamic-component-map.ts @@ -3,11 +3,55 @@ import { DynamicFormControlModel, } from '@athena/dynamic-core'; import { Type } from '@angular/core'; +import { FaultPlanAddRowComponent } from '../programs/basic-detail/fault-plan-add-row/fault-plan-add-row.component'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW, DynamicFaultPlanAddRowModel } from '../model/fault-plan-add-row/fault-plan-add-row.model'; +import { FaultPlanOperateFiledComponent } from '../programs/basic-detail/fault-plan-operate-filed/fault-plan-operate-filed.component'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED, DynamicFaultPlanOperateFiledModel } from '../model/fault-plan-operate-filed/fault-plan-operate-filed.model'; +import { WorkOrderEffectComponent } from '../programs/task-detail/work-order-effect/work-order-effect.component'; +import { DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT, DynamicWorkOrderEffectModel } from '../model/work-order-effect/work-order-effect.model'; +import { ProductPlanComponent } from '../programs/task-detail/product-plan/product-plan.component'; +import { DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN, DynamicProductPlanModel } from '../model/product-plan/product-plan.model'; +import { DeviceDetailComponent } from '../programs/task-detail/device-detail/device-detail.component'; +import { DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL, DynamicDeviceDetailModel } from '../model/device-detail/device-detail.model'; +import { DispatchListComponent } from '../programs/task-detail/dispatch-list/dispatch-list.component'; +import { DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST, DynamicDispatchListModel } from '../model/dispatch-list/dispatch-list.model'; +import { SettingBtnComponent } from '../programs/task-detail/setting-btn/setting-btn.component'; +import { DYNAMIC_CUSTOM__ATHENA_SETTING_BTN, DynamicSettingBtnModel } from '../model/setting-btn/setting-btn.model'; +import { TimeExpandComponent } from '../programs/task-detail/time-expand/time-expand.component'; +import { DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND, DynamicTimeExpandModel } from '../model/time-expand/time-expand.model'; +import { FaultCountComponent } from '../programs/task-detail/fault-count/fault-count.component'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT, DynamicFaultCountModel } from '../model/fault-count/fault-count.model'; +import { FaultDetailBtnComponent } from '../programs/task-detail/fault-detail-btn/fault-detail-btn.component'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN, DynamicFaultDetailBtnModel } from '../model/fault-detail-btn/fault-detail-btn.model'; +import { KnowledgeBaseComponent } from '../programs/task-detail/knowledge-base/knowledge-base.component'; +import { DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE, DynamicKnowledgeBaseModel } from '../model/knowledge-base/knowledge-base.model'; export function businessUIFormComponentMapFn( model: DynamicFormControlModel ): Type | null { switch (model.type) { + case DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE: + return KnowledgeBaseComponent; + case DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN: + return FaultDetailBtnComponent; + case DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT: + return FaultCountComponent; + case DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND: + return TimeExpandComponent; + case DYNAMIC_CUSTOM__ATHENA_SETTING_BTN: + return SettingBtnComponent; + case DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST: + return DispatchListComponent; + case DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL: + return DeviceDetailComponent; + case DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN: + return ProductPlanComponent; + case DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT: + return WorkOrderEffectComponent; + case DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED: + return FaultPlanOperateFiledComponent; + case DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW: + return FaultPlanAddRowComponent; default: break; } diff --git a/efm-demo-web/src/app/implementation/service/common.service.ts b/efm-demo-web/src/app/implementation/service/common.service.ts index 4d041b7..6a378b5 100644 --- a/efm-demo-web/src/app/implementation/service/common.service.ts +++ b/efm-demo-web/src/app/implementation/service/common.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; +import { Observable, Subject } from 'rxjs'; import { DwSystemConfigService } from '@webdpt/framework/config'; import { DW_AUTH_TOKEN } from '@webdpt/framework/auth'; @@ -16,6 +16,9 @@ export class CommonService { // 记录机制的content参数 content: any; uibotUrl: string; + dmpUrl: string; + messageSource = new Subject(); + // currentMessage = this.messageSource.asObservable(); constructor( @Inject(DW_AUTH_TOKEN) protected authToken: any, private http: HttpClient, @@ -39,6 +42,12 @@ export class CommonService { this.configService.get('uibotUrl').subscribe((url: string): void => { this.uibotUrl = url; }); + this.configService.get('dmpUrl').subscribe((url: string): void => { + this.dmpUrl = url || 'https://hw-test-dmp-demo.digiwincloud.com.cn'; + }); + } + sendMessage(message: string) { + this.messageSource.next(message); } /** * 获取inv_data @@ -53,9 +62,13 @@ export class CommonService { businessUnit: eoc || executeContext?.businessUnit, executeContext: executeContext, // 传参 }; - return this.http.post(`${this.atdmUrl}/api/atdm/v1/data/query/by/actionId`, _params, { - headers: this.getHeader(), - }); + return this.http.post( + `${this.atdmUrl}/api/atdm/v1/data/query/by/actionId`, + _params, + { + headers: this.getHeader(), + } + ); } /** @@ -69,13 +82,26 @@ export class CommonService { return this.http.post(url, params, { headers: this.getHeader() }); } - getHeader(): any { + getHeader(dmc?): any { if (this.authToken?.token) { return { 'digi-middleware-auth-user': this.authToken.token, token: this.authToken.token, }; } + + return {}; + } + + getDmcHeader(): any { + const token: any = + // eslint-disable-next-line max-len + "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImRtcCIsImluc2lkZSI6ZmFsc2UsInNpZCI6NDgzOTczNDM2NDQ1MjQ4fQ.qwhKIOpZzHE1k8rWa77tdOTtUaRVFjuQYYxx4WncfgE'"; + return { + 'digi-middleware-auth-user': token, + token: token, + }; + return {}; } @@ -119,5 +145,38 @@ export class CommonService { }); }); } - + /** + * + * @param params 维修档案接口 + * @returns + */ + maintenanceDmcUrl(params): any { + const url = `${this.dmpUrl}/search/mould/app/talent/user/dwd_equipment_maintenance_df`; + return this.http.post(url, params, { headers: this.getDmcHeader() }); + } + /** + * + * @param params 故障统计 + * @returns + */ + faultCountDmcUrl(params: any): Observable { + const url = `${this.dmpUrl}/search/mould/app/talent/user/dws_equipment_failure_mf`; + return this.http.post(url, params, { headers: this.getDmcHeader() }); + } + /** + * 故障统计明细 + * @param params + * @returns + */ + faultCountDetailDmcUrl(params: any): Observable { + const url = `${this.dmpUrl}/search/mould/app/talent/user/dwd_equipment_failure_df`; + return this.http.post(url, params, { headers: this.getDmcHeader() }); + } + /** + * 查询知识库 + */ + knowledgeBaseDmcUrl(params: any): Observable { + const url = `${this.dmpUrl}/search/mould/app/talent/user/dwd_failure_knowledge_df`; + return this.http.post(url, params, { headers: this.getDmcHeader() }); + } } diff --git a/efm-demo-web/src/app/implementation/service/dynamic-model-convert-bussiness.service.ts b/efm-demo-web/src/app/implementation/service/dynamic-model-convert-bussiness.service.ts index c41d331..a15c978 100644 --- a/efm-demo-web/src/app/implementation/service/dynamic-model-convert-bussiness.service.ts +++ b/efm-demo-web/src/app/implementation/service/dynamic-model-convert-bussiness.service.ts @@ -7,6 +7,17 @@ import { } from '@athena/dynamic-core'; import { Injectable } from '@angular/core'; import { SYSTEM_CONFIG } from 'app/config/system-config'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW, DynamicFaultPlanAddRowModel } from '../model/fault-plan-add-row/fault-plan-add-row.model'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED, DynamicFaultPlanOperateFiledModel } from '../model/fault-plan-operate-filed/fault-plan-operate-filed.model'; +import { DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT, DynamicWorkOrderEffectModel } from '../model/work-order-effect/work-order-effect.model'; +import { DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN, DynamicProductPlanModel } from '../model/product-plan/product-plan.model'; +import { DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL, DynamicDeviceDetailModel } from '../model/device-detail/device-detail.model'; +import { DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST, DynamicDispatchListModel } from '../model/dispatch-list/dispatch-list.model'; +import { DYNAMIC_CUSTOM__ATHENA_SETTING_BTN, DynamicSettingBtnModel } from '../model/setting-btn/setting-btn.model'; +import { DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND, DynamicTimeExpandModel } from '../model/time-expand/time-expand.model'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT, DynamicFaultCountModel } from '../model/fault-count/fault-count.model'; +import { DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN, DynamicFaultDetailBtnModel } from '../model/fault-detail-btn/fault-detail-btn.model'; +import { DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE, DynamicKnowledgeBaseModel } from '../model/knowledge-base/knowledge-base.model'; @Injectable() export class DynamicBusinessFormModelConvertService implements DynamicFormModelConvertService { @@ -30,11 +41,44 @@ export class DynamicBusinessFormModelConvertService implements DynamicFormModelC let result: DynamicFormControlModel; model.content = content; switch (model.type) { - default: - break; + case DYNAMIC_CUSTOM__ATHENA_KNOWLEDGE_BASE: + result = new DynamicKnowledgeBaseModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_FAULT_DETAIL_BTN: + result = new DynamicFaultDetailBtnModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_FAULT_COUNT: + result = new DynamicFaultCountModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_TIME_EXPAND: + result = new DynamicTimeExpandModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_SETTING_BTN: + result = new DynamicSettingBtnModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_DISPATCH_LIST: + result = new DynamicDispatchListModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_DEVICE_DETAIL: + result = new DynamicDeviceDetailModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_PRODUCT_PLAN: + result = new DynamicProductPlanModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_WORK_ORDER_EFFECT: + result = new DynamicWorkOrderEffectModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_OPERATE_FILED: + result = new DynamicFaultPlanOperateFiledModel(model, layout); + break; + case DYNAMIC_CUSTOM__ATHENA_FAULT_PLAN_ADD_ROW: + result = new DynamicFaultPlanAddRowModel(model, layout); + break; + default: + break; } /** 渲染定制组件时,将应用信息传给service */ - if (!!result) { this.customAppConfigService.customConfig = { appCode: SYSTEM_CONFIG.dwAppId };} + if (!!result) { this.customAppConfigService.customConfig = { appCode: SYSTEM_CONFIG.dwAppId }; } return result; } } diff --git a/efm-demo-web/src/app/implementation/shared/cust-shared.module.ts b/efm-demo-web/src/app/implementation/shared/cust-shared.module.ts index 9ab832f..cce3cd8 100644 --- a/efm-demo-web/src/app/implementation/shared/cust-shared.module.ts +++ b/efm-demo-web/src/app/implementation/shared/cust-shared.module.ts @@ -3,6 +3,21 @@ import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { DynamicFormsAntUIModule } from '@athena/dynamic-ui'; +import { AthFormModule } from '@athena/design-ui/src/components/form'; +import { AthGridModule } from '@athena/design-ui/src/components/grid'; +// import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { AthTooltipModule } from '@athena/design-ui/src/components/tooltip'; +import { AthInputModule } from '@athena/design-ui/src/components/input'; +import { AthButtonModule } from '@athena/design-ui/src/components/button'; +import { AthContainExplicitModule } from '@athena/design-ui/src/components/contain-explicit'; +import { IconModule } from '@athena/design-ui/src/components/icon'; +import { AthUploadModule } from '@athena/design-ui/src/components/upload'; +import { AthSelectModule } from '@athena/design-ui/src/components/select'; +import { AthInputNumberModule } from '@athena/design-ui/src/components/input-number'; +import { AthCheckboxModule } from '@athena/design-ui/src/components/checkbox'; +import { AthTableModule } from '@athena/design-ui/src/components/table'; +import { AthTabsModule } from '@athena/design-ui/src/components/tabs'; +import { AthDatePickerModule } from '@athena/design-ui/src/components/date-picker'; @NgModule({ imports: [ @@ -11,6 +26,20 @@ import { DynamicFormsAntUIModule } from '@athena/dynamic-ui'; ReactiveFormsModule, TranslateModule, DynamicFormsAntUIModule, + AthFormModule, + AthGridModule, + AthTooltipModule, + AthInputModule, + AthButtonModule, + AthContainExplicitModule, + IconModule, + AthUploadModule, + AthSelectModule, + AthInputNumberModule, + AthCheckboxModule, + AthTableModule, + AthTabsModule, + AthDatePickerModule, ], exports: [ CommonModule, @@ -18,7 +47,20 @@ import { DynamicFormsAntUIModule } from '@athena/dynamic-ui'; ReactiveFormsModule, TranslateModule, DynamicFormsAntUIModule, - ] + AthFormModule, + AthGridModule, + AthTooltipModule, + AthInputModule, + AthButtonModule, + AthContainExplicitModule, + IconModule, + AthUploadModule, + AthSelectModule, + AthInputNumberModule, + AthCheckboxModule, + AthTableModule, + AthTabsModule, + AthDatePickerModule, + ], }) - -export class CustSharedModule { } +export class CustSharedModule {} diff --git a/efm-demo-web/src/assets/api/api-device-detail.json b/efm-demo-web/src/assets/api/api-device-detail.json new file mode 100644 index 0000000..ac843f0 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-device-detail.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "device-detail", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-dispatch-list.json b/efm-demo-web/src/assets/api/api-dispatch-list.json new file mode 100644 index 0000000..f1d170d --- /dev/null +++ b/efm-demo-web/src/assets/api/api-dispatch-list.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "dispatch-list", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-fault-count.json b/efm-demo-web/src/assets/api/api-fault-count.json new file mode 100644 index 0000000..d65e5ec --- /dev/null +++ b/efm-demo-web/src/assets/api/api-fault-count.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "fault-count", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-fault-detail-btn.json b/efm-demo-web/src/assets/api/api-fault-detail-btn.json new file mode 100644 index 0000000..55812d7 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-fault-detail-btn.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "fault-detail-btn", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-fault-plan-add-row.json b/efm-demo-web/src/assets/api/api-fault-plan-add-row.json new file mode 100644 index 0000000..3ad5243 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-fault-plan-add-row.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "fault-plan-add-row", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-fault-plan-operate-filed.json b/efm-demo-web/src/assets/api/api-fault-plan-operate-filed.json new file mode 100644 index 0000000..9bec8cc --- /dev/null +++ b/efm-demo-web/src/assets/api/api-fault-plan-operate-filed.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "operate_filed", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-knowledge-base.json b/efm-demo-web/src/assets/api/api-knowledge-base.json new file mode 100644 index 0000000..9748cb1 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-knowledge-base.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "knowledge-base", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-product-plan.json b/efm-demo-web/src/assets/api/api-product-plan.json new file mode 100644 index 0000000..4acb67d --- /dev/null +++ b/efm-demo-web/src/assets/api/api-product-plan.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "product-plan", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-setting-btn.json b/efm-demo-web/src/assets/api/api-setting-btn.json new file mode 100644 index 0000000..f856d43 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-setting-btn.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "setting-btn", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-time-expand.json b/efm-demo-web/src/assets/api/api-time-expand.json new file mode 100644 index 0000000..77c6933 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-time-expand.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "time-expand", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file diff --git a/efm-demo-web/src/assets/api/api-work-order-effect.json b/efm-demo-web/src/assets/api/api-work-order-effect.json new file mode 100644 index 0000000..480ae33 --- /dev/null +++ b/efm-demo-web/src/assets/api/api-work-order-effect.json @@ -0,0 +1,24 @@ +{ + "status": 200, + "statusDescription": "OK", + "response": { + "layout": [ + { + "id": "62a48f59-1e67-474d-bb7d-7b6fd2b4d0ee", + "type": "word-order-effect", + "schema": "customData", + "supportShowInMaxedWindow": true + } + ], + "style": {}, + "rules": [], + "pageData": { + "customData": [] + }, + "pageDataIndex": {}, + "pageDataKeys": {}, + "content": {}, + "executeContext": {}, + "pageCountSize": 1 + } +} \ No newline at end of file