Spaces:
Running
Running
| /** | |
| * Copyright (c) 2017~2019, OBCon Inc. | |
| * All rights reserved. | |
| */ | |
| /** | |
| * @file | |
| * @copyright 2017~2019, OBCon Inc. | |
| * @author gye hyun james kim [pnuskgh@gmail.com] | |
| */ | |
| //--- http://docs.sequelizejs.com/ | |
| let Sequelize = require('sequelize'); | |
| let Model = utils.getClass('include', 'model.js'); | |
| class TasksModel extends Model { | |
| constructor() { | |
| super(); | |
| this._title = '작업'; | |
| this._database = db.db_scada; | |
| this._tableName = 'tasks'; | |
| } | |
| get fields() { | |
| return Object.assign({ | |
| site: { | |
| type: Sequelize.INTEGER(11), | |
| allowNull: false, | |
| defaultValue: 1, | |
| validate: { | |
| }, | |
| title: '사이트', | |
| strType: 'integer' | |
| }, | |
| parent: { | |
| type: Sequelize.INTEGER(11), | |
| allowNull: true, | |
| validate: { | |
| }, | |
| title: '관련 모듈 ID', | |
| strType: 'integer' | |
| }, | |
| parentType: { | |
| type: Sequelize.STRING(32), | |
| allowNull: false, | |
| validate: { | |
| }, | |
| title: '관련 모듈 Type', | |
| strType: 'select', | |
| enum: [ ['devices', '장비'] ] | |
| }, | |
| parentName: { | |
| type: Sequelize.STRING(72), | |
| allowNull: true, | |
| validate: { | |
| }, | |
| title: '관련 모듈', | |
| strType: 'string' | |
| }, | |
| status: { | |
| type: Sequelize.STRING(8), | |
| allowNull: false, | |
| defaultValue: 'Progress', | |
| validate: { | |
| }, | |
| title: '상태', | |
| strType: 'select', | |
| enum: [ ['Progress', '진행중'], ['Ready', '준비중'], ['Complete', '완료됨'], ['Cancel', '취소됨'] ] | |
| }, | |
| //--- yyyy-mm-dd hh:mm:ss | |
| dateStart: { | |
| type: Sequelize.STRING(32), | |
| allowNull: true, | |
| validate: { | |
| }, | |
| title: '시작일시', | |
| strType: 'datetime' | |
| }, | |
| dateEnd: { | |
| type: Sequelize.STRING(32), | |
| allowNull: true, | |
| validate: { | |
| }, | |
| title: '종료일시', | |
| strType: 'datetime' | |
| }, | |
| periority: { | |
| type: Sequelize.STRING(8), | |
| allowNull: false, | |
| defaultValue: 'Middle', | |
| validate: { | |
| }, | |
| title: '우선순위', | |
| strType: 'select', | |
| enum: [ ['Low', '낮음'], ['Middle', '중간'], ['High', '높음'] ] | |
| } | |
| }, super.fields); | |
| } | |
| } | |
| module.exports = TasksModel; | |