6 Commits

Author SHA1 Message Date
  Red Forks e6e3b5a894 Uses <DateInput> widget 8 years ago
  Red Forks 28b58456e8 Restyle main window 8 years ago
  Red Forks 6639517e6e Enable tslib 8 years ago
  Red Forks f99691c659 Enable tslint 8 years ago
  Red Forks 9c096a18e1 Uses <Led> widget 8 years ago
  Red Forks a6ee401da9 Root window layout unit switch to lg 8 years ago
8 changed files with 601 additions and 288 deletions
Split View
  1. +6
    -1
      index.html
  2. +1
    -1
      main.ts
  3. +535
    -259
      package-lock.json
  4. +4
    -1
      package.json
  5. +1
    -1
      src/index.tsx
  6. +39
    -24
      src/main-view/container.tsx
  7. +1
    -1
      tsconfig.json
  8. +14
    -0
      tslint.json

+ 6
- 1
index.html View File

@ -10,7 +10,8 @@
<!-- Bootstrap -->
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="./node_modules/react-datetime/css/react-datetime.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@ -23,6 +24,10 @@
font-family: "7bar";
src: url("./digital-7.ttf");
}
body {
background-color: #d4d0c8;
}
</style>
</head>


+ 1
- 1
main.ts View File

@ -1,4 +1,4 @@
import { start } from "mammoth";
import * as path from "path";
start(path.join(__dirname, "index.html"));
start(path.join(__dirname, "index.html"));

+ 535
- 259
package-lock.json
File diff suppressed because it is too large
View File


+ 4
- 1
package.json View File

@ -12,7 +12,10 @@
"dependencies": {
"@types/react-router-redux": "^5.0.10",
"electron": "^1.7.10",
"mammoth": "git+file:///home/forks/work/mammoth-lib.git"
"mammoth": "git+file:///home/forks/work/mammoth-lib.git",
"moment": "^2.20.1",
"react-datetime": "^2.11.1",
"tslint": "^5.8.0"
},
"devDependencies": {
"typescript": "^2.6.2"


+ 1
- 1
src/index.tsx View File

@ -20,7 +20,7 @@ ReactDOM.render(
</ConnectedRouter>
</Provider>,
document.getElementById("root"),
)
);
function Root() {
return <div><a onClick={() => pushState("/login")}>Goto login</a></div>;


+ 39
- 24
src/main-view/container.tsx View File

@ -2,29 +2,44 @@ import * as React from "react";
import { connect, Dispatch } from "react-redux";
import { StMainView, StAppWithMainView } from ".";
import { Grid, Row, Col, Table, ButtonToolbar, Button, Panel, FormControl, Checkbox } from "react-bootstrap";
import "mammoth/ui/jss";
import { Led } from "mammoth/ui/led";
import { DateInput } from "mammoth/ui/date-input";
import jss from "jss";
import preset from "jss-preset-default";
jss.setup(preset());
const sheet = jss.createStyleSheet({
pnl: {
height: "calc(100% - 20px)",
},
topRow: {
maxHeight: "20vh",
paddingTop: 10,
paddingBottom: 10,
},
gap: {
marginBottom: 5,
}
}).attach();
interface Props { };
interface Callbacks { };
function mainView(props: Props & Callbacks) {
const weightPanel = {
color: "#ff4300",
backgroundColor: "black",
fontSize: "7rem",
fontFamily: "\"7bar\"",
};
return <Grid>
<Row style={{ height: "calc(20vh - 50px)" }}>
<Col xs={3}>
<div style={weightPanel}>0.00</div>
<ButtonToolbar>
<Row className={sheet.classes.topRow}>
<Col lg={3}>
<Led className={sheet.classes.gap} text="0.00" />
<ButtonToolbar className={sheet.classes.gap}>
<Button></Button>
<Button disabled></Button>
</ButtonToolbar>
<div><input /></div>
<div><DateInput /></div>
</Col>
<Col xs={5} style={{ height: "15vh", flexWrap: "wrap", display: "flex", flexDirection: "column", alignItems: "flex-start" }}>
<Col lg={5} style={{ height: "15vh", flexWrap: "wrap", display: "flex", flexDirection: "column", alignItems: "flex-start" }}>
<Checkbox></Checkbox>
<Button></Button>
<Button></Button>
@ -33,7 +48,7 @@ function mainView(props: Props & Callbacks) {
<div style={{ flex: 1 }}></div>
<div style={{ alignSelf: "flex-end" }}>屠宰顺序: 0 已宰头数: 0</div>
</Col>
<Col xs={4}>
<Col lg={4}>
<ButtonToolbar>
<Button bsSize="large"></Button>
<Button bsSize="large"></Button>
@ -42,10 +57,10 @@ function mainView(props: Props & Callbacks) {
</Col>
</Row>
<Row>
<Col xs={8}>
<Row>
<Panel style={{ height: "40vh" }} header="烫褪">
<Col xs={6} >
<Col lg={8}>
<Row style={{ height: "40vh" }}>
<Panel className={sheet.classes.pnl} header="烫褪">
<Col lg={6} >
<Table >
<thead>
<tr>
@ -57,7 +72,7 @@ function mainView(props: Props & Callbacks) {
</thead>
</Table>
</Col>
<Col xs={6}>
<Col lg={6}>
<ButtonToolbar>
<Button bsStyle="info"></Button>
<Button bsStyle="info"></Button>
@ -66,9 +81,9 @@ function mainView(props: Props & Callbacks) {
</Col>
</Panel>
</Row>
<Row>
<Panel style={{ height: "40vh" }} header="毛剥">
<Col xs={6}>
<Row style={{ height: "40vh" }} >
<Panel className={sheet.classes.pnl} header="毛剥">
<Col lg={6}>
<Table>
<thead>
<tr>
@ -80,7 +95,7 @@ function mainView(props: Props & Callbacks) {
</thead>
</Table>
</Col>
<Col xs={6}>
<Col lg={6}>
<ButtonToolbar>
<Button></Button>
<Button></Button>
@ -90,8 +105,8 @@ function mainView(props: Props & Callbacks) {
</Panel>
</Row>
</Col>
<Col xs={4}>
<Panel style={{ height: "calc(80vh + 20px)" }} header="记录">
<Col lg={4} style={{ height: "80vh" }} >
<Panel className={sheet.classes.pnl} header="记录">
<Table>
<thead>
<tr>


+ 1
- 1
tsconfig.json View File

@ -14,7 +14,7 @@
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */


+ 14
- 0
tslint.json View File

@ -0,0 +1,14 @@
{
"extends": "tslint:recommended",
"rules": {
"max-line-length": {
"options": [
120
]
},
"arrow-parens": false,
"ordered-imports": false,
"interface-name": false,
"object-literal-sort-keys": false
}
}

Loading…
Cancel
Save