@isxiaoyuan/elpis 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +3 -0
- package/.eslintrc +52 -0
- package/.vscode/settings.json +8 -0
- package/REMADE.md +228 -0
- package/app/controller/base.js +43 -0
- package/app/controller/project.js +106 -0
- package/app/controller/view.js +21 -0
- package/app/extend/logger.js +36 -0
- package/app/middleware/api-params-verify.js +73 -0
- package/app/middleware/api-sign-verify.js +43 -0
- package/app/middleware/error-handler.js +33 -0
- package/app/middleware/project-handle.js +26 -0
- package/app/middleware.js +41 -0
- package/app/pages/asserts/custom.css +11 -0
- package/app/pages/boot.js +43 -0
- package/app/pages/common/curl.js +88 -0
- package/app/pages/common/utils.js +2 -0
- package/app/pages/dashboard/complex-view/header-view/complex-view/sub-menu/sub-menu.vue +19 -0
- package/app/pages/dashboard/complex-view/header-view/header-view.vue +138 -0
- package/app/pages/dashboard/complex-view/iframe-view/iframe-view.vue +51 -0
- package/app/pages/dashboard/complex-view/schema-view/complex-view/search-panel/search-panel.vue +41 -0
- package/app/pages/dashboard/complex-view/schema-view/complex-view/table-panel/table-panel.vue +128 -0
- package/app/pages/dashboard/complex-view/schema-view/components/component-config.js +20 -0
- package/app/pages/dashboard/complex-view/schema-view/components/create-form/create-form.vue +95 -0
- package/app/pages/dashboard/complex-view/schema-view/components/detail-panel/detail-panel.vue +98 -0
- package/app/pages/dashboard/complex-view/schema-view/components/edit-form/edit-form.vue +123 -0
- package/app/pages/dashboard/complex-view/schema-view/hook/schema.js +129 -0
- package/app/pages/dashboard/complex-view/schema-view/schema-view.vue +98 -0
- package/app/pages/dashboard/complex-view/silder-view/silder-view.vue +127 -0
- package/app/pages/dashboard/dashboard.vue +96 -0
- package/app/pages/dashboard/entry.dashboard.js +48 -0
- package/app/pages/store/index.js +5 -0
- package/app/pages/store/menu.js +70 -0
- package/app/pages/store/project.js +17 -0
- package/app/pages/widgets/header-container/asserts/avatar.png +0 -0
- package/app/pages/widgets/header-container/asserts/logo.png +0 -0
- package/app/pages/widgets/header-container/header-container.vue +102 -0
- package/app/pages/widgets/schema-form/complex-view/input/input.vue +137 -0
- package/app/pages/widgets/schema-form/complex-view/input-number/input-number.vue +136 -0
- package/app/pages/widgets/schema-form/complex-view/select/select.vue +122 -0
- package/app/pages/widgets/schema-form/form-item-config.js +20 -0
- package/app/pages/widgets/schema-form/schema-form.vue +136 -0
- package/app/pages/widgets/schema-search-bar/complex-view/date-range/date-range.vue +55 -0
- package/app/pages/widgets/schema-search-bar/complex-view/dynamic-select/dynamic-select.vue +69 -0
- package/app/pages/widgets/schema-search-bar/complex-view/input/input.vue +45 -0
- package/app/pages/widgets/schema-search-bar/complex-view/select/select.vue +53 -0
- package/app/pages/widgets/schema-search-bar/schema-item-config.js +24 -0
- package/app/pages/widgets/schema-search-bar/schema-search-bar.vue +115 -0
- package/app/pages/widgets/schema-table/schema-table.vue +255 -0
- package/app/pages/widgets/sider-container/complex-view/sub-menu/sub-menu.vue +18 -0
- package/app/pages/widgets/sider-container/sider-container.vue +29 -0
- package/app/public/dist/entry.dashboard.tpl +27 -0
- package/app/public/dist/entry.page1.tpl +25 -0
- package/app/public/dist/entry.page2.tpl +25 -0
- package/app/public/dist/entry.project-list.tpl +27 -0
- package/app/public/static/logo.png +0 -0
- package/app/public/static/normalize.css +239 -0
- package/app/router/project.js +12 -0
- package/app/router/view.js +7 -0
- package/app/router-schema/project.js +30 -0
- package/app/service/base.js +13 -0
- package/app/service/project.js +58 -0
- package/app/view/entry.tpl +27 -0
- package/app/webpack/config/webpack.base.js +305 -0
- package/app/webpack/config/webpack.dev.js +62 -0
- package/app/webpack/config/webpack.prod.js +120 -0
- package/app/webpack/dev.js +62 -0
- package/app/webpack/libs/blank.js +1 -0
- package/app/webpack/prod.js +22 -0
- package/config/config.beta.js +3 -0
- package/config/config.default.js +3 -0
- package/config/config.prod.js +3 -0
- package/elpis-core/env.js +20 -0
- package/elpis-core/index.js +97 -0
- package/elpis-core/loader/config.js +66 -0
- package/elpis-core/loader/controller.js +86 -0
- package/elpis-core/loader/extend.js +66 -0
- package/elpis-core/loader/middleware.js +74 -0
- package/elpis-core/loader/router-schema.js +56 -0
- package/elpis-core/loader/router.js +49 -0
- package/elpis-core/loader/service.js +82 -0
- package/index.js +42 -0
- package/model/index.js +109 -0
- package/package.json +92 -0
- package/test/controller/project.test.js +188 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="schema-table">
|
|
3
|
+
<el-table
|
|
4
|
+
v-if="schema && schema.properties"
|
|
5
|
+
v-loading="loading"
|
|
6
|
+
:data="tableData"
|
|
7
|
+
class="table"
|
|
8
|
+
>
|
|
9
|
+
<template v-for="(schemaItem, key) in schema.properties">
|
|
10
|
+
<el-table-column
|
|
11
|
+
v-if="schemaItem.option.visible !== false"
|
|
12
|
+
:key="key"
|
|
13
|
+
:prop="key"
|
|
14
|
+
:label="schemaItem.label || key"
|
|
15
|
+
v-bind="schemaItem.tableOption"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
<el-table-column
|
|
19
|
+
v-if="buttons?.length > 0"
|
|
20
|
+
label="操作"
|
|
21
|
+
fixed="right"
|
|
22
|
+
:width="operationWidth"
|
|
23
|
+
>
|
|
24
|
+
<template #default="scoped">
|
|
25
|
+
<el-button
|
|
26
|
+
v-for="item in buttons"
|
|
27
|
+
link
|
|
28
|
+
v-bind="item"
|
|
29
|
+
@click="handleOperation({ btnConfig: item, rowData: scoped.row })"
|
|
30
|
+
>
|
|
31
|
+
{{ item.label }}
|
|
32
|
+
</el-button>
|
|
33
|
+
</template>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
</el-table>
|
|
36
|
+
<el-row class="pagination" justify="end">
|
|
37
|
+
<el-pagination
|
|
38
|
+
:current-page="currentPage"
|
|
39
|
+
:page-size="pageSize"
|
|
40
|
+
:page-sizes="[10, 20, 50, 100]"
|
|
41
|
+
:total="total"
|
|
42
|
+
:layout="layout"
|
|
43
|
+
@size-change="handleSizeChange"
|
|
44
|
+
@current-change="handleCurrentChange"
|
|
45
|
+
/>
|
|
46
|
+
</el-row>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup>
|
|
51
|
+
import { ref, toRefs, computed, watch, nextTick, onMounted } from "vue";
|
|
52
|
+
|
|
53
|
+
import $curl from "$elpisCommon/curl.js";
|
|
54
|
+
|
|
55
|
+
const props = defineProps({
|
|
56
|
+
/**
|
|
57
|
+
* schema 配置,结构如下
|
|
58
|
+
{
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
key: {
|
|
62
|
+
...schema,
|
|
63
|
+
type: "", // 字段类型
|
|
64
|
+
label: "", // 字段中文名
|
|
65
|
+
option: {
|
|
66
|
+
...elTableColumnConfig, // 标准 el-table-cloumn 配置
|
|
67
|
+
visible: true, // 是否在 table 中显示
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
*/
|
|
73
|
+
schema: {
|
|
74
|
+
type: Object,
|
|
75
|
+
default: () => {},
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* 接口地址
|
|
79
|
+
*/
|
|
80
|
+
api: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "",
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* 接口参数
|
|
86
|
+
*/
|
|
87
|
+
apiParams: {
|
|
88
|
+
type: Object,
|
|
89
|
+
default: () => {},
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* buttons 操作按钮相关配置 配置如下
|
|
93
|
+
* [{
|
|
94
|
+
label: "", // 按钮中文名
|
|
95
|
+
evenKey: "", // 按钮事件名
|
|
96
|
+
eventOption: {}, // 按钮具体配置
|
|
97
|
+
...elButtonConfig, // 标准 el-button 配置
|
|
98
|
+
},...]
|
|
99
|
+
*/
|
|
100
|
+
buttons: {
|
|
101
|
+
type: Array,
|
|
102
|
+
default: () => [],
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* 分页布局
|
|
106
|
+
*/
|
|
107
|
+
layout: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: "total, sizes, prev, pager, next, jumper",
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const { schema, api, buttons, apiParams } = toRefs(props);
|
|
114
|
+
|
|
115
|
+
const emit = defineEmits(["operate"]);
|
|
116
|
+
|
|
117
|
+
const operationWidth = computed(() => {
|
|
118
|
+
return buttons?.value?.length > 0
|
|
119
|
+
? buttons?.value?.reduce((pre, cur) => {
|
|
120
|
+
return pre + cur.label.length * 18;
|
|
121
|
+
}, 50)
|
|
122
|
+
: 50;
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const loading = ref(false);
|
|
126
|
+
const tableData = ref([]);
|
|
127
|
+
const currentPage = ref(1);
|
|
128
|
+
const pageSize = ref(50);
|
|
129
|
+
const total = ref(0);
|
|
130
|
+
|
|
131
|
+
onMounted(() => {
|
|
132
|
+
initData();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
watch(
|
|
136
|
+
[schema, api, apiParams],
|
|
137
|
+
() => {
|
|
138
|
+
initData();
|
|
139
|
+
},
|
|
140
|
+
{ deep: true },
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const initData = () => {
|
|
144
|
+
currentPage.value = 1;
|
|
145
|
+
pageSize.value = 50;
|
|
146
|
+
nextTick(async () => {
|
|
147
|
+
await loadTableData();
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
let timerId = null;
|
|
152
|
+
const loadTableData = async () => {
|
|
153
|
+
clearTimeout(timerId);
|
|
154
|
+
timerId = setTimeout(async () => {
|
|
155
|
+
await fetchTableData();
|
|
156
|
+
timerId = null;
|
|
157
|
+
}, 100);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const fetchTableData = async () => {
|
|
161
|
+
if (!api.value) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
showLoading();
|
|
165
|
+
try {
|
|
166
|
+
const res = await $curl({
|
|
167
|
+
url: `${api.value}/list`,
|
|
168
|
+
method: "get",
|
|
169
|
+
query: {
|
|
170
|
+
...apiParams.value,
|
|
171
|
+
page: currentPage.value,
|
|
172
|
+
size: pageSize.value,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
if (res.data && res.data.length > 0) {
|
|
176
|
+
tableData.value = buildTableData(res.data);
|
|
177
|
+
}
|
|
178
|
+
total.value = res.metadata?.total || 0;
|
|
179
|
+
} catch (error) {
|
|
180
|
+
console.log(error);
|
|
181
|
+
} finally {
|
|
182
|
+
hideLoading();
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 对后端返回的数据进行渲染前的预处理
|
|
188
|
+
* @param {Object} listData 列表数据
|
|
189
|
+
*/
|
|
190
|
+
const buildTableData = (listData) => {
|
|
191
|
+
if (!schema.value?.properties) {
|
|
192
|
+
return listData;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return listData.map((rowData) => {
|
|
196
|
+
for (const dKey in rowData) {
|
|
197
|
+
const schemaItem = schema.value?.properties[dKey];
|
|
198
|
+
if (schemaItem?.option?.toFixed) {
|
|
199
|
+
rowData[dKey] =
|
|
200
|
+
rowData[dKey].toFixed &&
|
|
201
|
+
rowData[dKey].toFixed(schemaItem?.option?.toFixed);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return rowData;
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const showLoading = () => {
|
|
209
|
+
loading.value = true;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const hideLoading = () => {
|
|
213
|
+
loading.value = false;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// 处理操作按钮点击事件
|
|
217
|
+
const handleOperation = ({ btnConfig, rowData }) => {
|
|
218
|
+
emit("operate", { btnConfig, rowData });
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const handleSizeChange = async (val) => {
|
|
222
|
+
pageSize.value = val;
|
|
223
|
+
await loadTableData();
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const handleCurrentChange = async (val) => {
|
|
227
|
+
currentPage.value = val;
|
|
228
|
+
await loadTableData();
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
defineExpose({
|
|
232
|
+
initData,
|
|
233
|
+
loadTableData,
|
|
234
|
+
showLoading,
|
|
235
|
+
hideLoading,
|
|
236
|
+
});
|
|
237
|
+
</script>
|
|
238
|
+
|
|
239
|
+
<style scoped lang="less">
|
|
240
|
+
.schema-table {
|
|
241
|
+
flex: 1;
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
overflow: auto;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.table {
|
|
248
|
+
flex: 1;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.pagination {
|
|
252
|
+
margin: 10px 0;
|
|
253
|
+
text-align: right;
|
|
254
|
+
}
|
|
255
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-sub-menu :index="menuItem.key">
|
|
3
|
+
<template #title>{{ menuItem.name }}</template>
|
|
4
|
+
<div v-for="item in menuItem.subMenu" :key="item.key">
|
|
5
|
+
<sub-menu
|
|
6
|
+
:menu-item="item"
|
|
7
|
+
v-if="item.subMenu && item.subMenu.length > 0"
|
|
8
|
+
/>
|
|
9
|
+
<el-menu-item v-else :index="item.key">{{ item.name }}</el-menu-item>
|
|
10
|
+
</div>
|
|
11
|
+
</el-sub-menu>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
const { menuItem } = defineProps(["menuItem"]);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style scoped lang="less"></style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-container class="sider-container">
|
|
3
|
+
<!-- 侧边导航 -->
|
|
4
|
+
<el-aside width="200px" class="aside">
|
|
5
|
+
<slot name="menu-container"></slot>
|
|
6
|
+
</el-aside>
|
|
7
|
+
<el-main class="main">
|
|
8
|
+
<slot name="main-container"></slot>
|
|
9
|
+
</el-main>
|
|
10
|
+
</el-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup></script>
|
|
14
|
+
|
|
15
|
+
<style scoped lang="less">
|
|
16
|
+
.sider-container {
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
.aside {
|
|
20
|
+
border-right: 1px solid #e8e8e8;
|
|
21
|
+
}
|
|
22
|
+
.main {
|
|
23
|
+
overflow: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:deep(.el-menu) {
|
|
27
|
+
border-right: 0;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<link href="/static/normalize.css" rel="stylesheet">
|
|
6
|
+
<link href="/static/logo.png" rel="icon" type="image/x-icon">
|
|
7
|
+
<title>{{name}}</title>
|
|
8
|
+
<script defer src="http://127.0.0.2:9002/public/dist/dev/js/runtime~entry.dashboard_ccdd5987.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/vendor_2d349590.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/common_ba73051e.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/entry.dashboard_ba6bcc72.bundle.js"></script></head>
|
|
9
|
+
|
|
10
|
+
<body style="margin: 0;">
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<input id="projKey" name="projKey" value="{{projKey}}" style="display:none;">
|
|
13
|
+
<input id="env" name="env" value="{{env}}" style="display:none;">
|
|
14
|
+
<input id="options" name="options" value="{{options}}" style="display:none;">
|
|
15
|
+
</body>
|
|
16
|
+
<script type="text/javascript">
|
|
17
|
+
try {
|
|
18
|
+
window.projKey = document.getElementById("projKey").value;
|
|
19
|
+
window.env = document.getElementById("env").value;
|
|
20
|
+
const options = document.getElementById("options").value;
|
|
21
|
+
window.options = JSON.parse(options);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.log(e);
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<link href="/static/normalize.css" rel="stylesheet">
|
|
6
|
+
<link href="/static/logo.png" rel="icon" type="image/x-icon">
|
|
7
|
+
<title>{{name}}</title>
|
|
8
|
+
<script defer src="http://127.0.0.2:9002/public/dist/dev/js/runtime~entry.page1_36b95ec6.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/vendor_8245c48c.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/entry.page1_6389798d.bundle.js"></script></head>
|
|
9
|
+
|
|
10
|
+
<body style="color:red;">
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<input id="env" name="env" value="{{env}}" style="display:none;">
|
|
13
|
+
<input id="options" name="options" value="{{options}}" style="display:none;">
|
|
14
|
+
</body>
|
|
15
|
+
<script type="text/javascript">
|
|
16
|
+
try {
|
|
17
|
+
window.env = document.getElementById("env").value;
|
|
18
|
+
const options = document.getElementById("options").value;
|
|
19
|
+
window.options = JSON.parse(options);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.log(e);
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<link href="/static/normalize.css" rel="stylesheet">
|
|
6
|
+
<link href="/static/logo.png" rel="icon" type="image/x-icon">
|
|
7
|
+
<title>{{name}}</title>
|
|
8
|
+
<script defer src="http://127.0.0.2:9002/public/dist/dev/js/runtime~entry.page2_38c5cb7b.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/vendor_8245c48c.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/entry.page2_2b1f94bc.bundle.js"></script></head>
|
|
9
|
+
|
|
10
|
+
<body style="color:red;">
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<input id="env" name="env" value="{{env}}" style="display:none;">
|
|
13
|
+
<input id="options" name="options" value="{{options}}" style="display:none;">
|
|
14
|
+
</body>
|
|
15
|
+
<script type="text/javascript">
|
|
16
|
+
try {
|
|
17
|
+
window.env = document.getElementById("env").value;
|
|
18
|
+
const options = document.getElementById("options").value;
|
|
19
|
+
window.options = JSON.parse(options);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.log(e);
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<link href="/static/normalize.css" rel="stylesheet">
|
|
6
|
+
<link href="/static/logo.png" rel="icon" type="image/x-icon">
|
|
7
|
+
<title>{{name}}</title>
|
|
8
|
+
<script defer src="http://127.0.0.2:9002/public/dist/dev/js/runtime~entry.project-list_db9087cf.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/vendor_2d349590.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/common_ba73051e.bundle.js"></script><script defer src="http://127.0.0.2:9002/public/dist/dev/js/entry.project-list_65caa4f1.bundle.js"></script></head>
|
|
9
|
+
|
|
10
|
+
<body style="margin: 0;">
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<input id="projKey" name="projKey" value="{{projKey}}" style="display:none;">
|
|
13
|
+
<input id="env" name="env" value="{{env}}" style="display:none;">
|
|
14
|
+
<input id="options" name="options" value="{{options}}" style="display:none;">
|
|
15
|
+
</body>
|
|
16
|
+
<script type="text/javascript">
|
|
17
|
+
try {
|
|
18
|
+
window.projKey = document.getElementById("projKey").value;
|
|
19
|
+
window.env = document.getElementById("env").value;
|
|
20
|
+
const options = document.getElementById("options").value;
|
|
21
|
+
window.options = JSON.parse(options);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.log(e);
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 1. Set default font family to sans-serif.
|
|
5
|
+
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
|
6
|
+
* user zoom.
|
|
7
|
+
*/
|
|
8
|
+
html,body,span,div,p,a,table,tbody,td,h1,h2,h3,img,form,font,strong,b,i,dl,dt,dd,ol,ul,li,dl,dd,dt,iframe,label,blockquote,input,button
|
|
9
|
+
{
|
|
10
|
+
padding: 0;
|
|
11
|
+
margin: 0;
|
|
12
|
+
list-style: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html {
|
|
16
|
+
font-family: "Open Sans","Helvetica Neue","Microsoft Yahei",sans-serif;/* 1 */
|
|
17
|
+
-ms-text-size-adjust: 100%; /* 2 */
|
|
18
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Remove default margin.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Links
|
|
30
|
+
========================================================================== */
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Remove the gray background color from active links in IE 10.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
a {
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Improve readability when focused and also mouse hovered in all browsers.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
a:active,
|
|
46
|
+
a:hover {
|
|
47
|
+
outline: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Text-level semantics
|
|
51
|
+
========================================================================== */
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
b,
|
|
58
|
+
strong {
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Embedded content
|
|
63
|
+
========================================================================== */
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Remove border when inside `a` element in IE 8/9/10.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
img {
|
|
70
|
+
border: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
/* Grouping content
|
|
75
|
+
========================================================================== */
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Address margin not present in IE 8/9 and Safari.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
figure {
|
|
82
|
+
margin: 1em 40px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/* Forms
|
|
87
|
+
========================================================================== */
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
|
91
|
+
* styling of `select`, unless a `border` property is set.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 1. Correct color not being inherited.
|
|
96
|
+
a * Known issue: affects color of disabled elements.
|
|
97
|
+
* 2. Correct font properties not being inherited.
|
|
98
|
+
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
button,
|
|
102
|
+
input,
|
|
103
|
+
optgroup,
|
|
104
|
+
select,
|
|
105
|
+
textarea {
|
|
106
|
+
color: inherit; /* 1 */
|
|
107
|
+
font: inherit; /* 2 */
|
|
108
|
+
margin: 0; /* 3 */
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Address `overflow` set to `hidden` in IE 8/9/10/11.
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
button {
|
|
116
|
+
overflow: visible;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
|
121
|
+
* All other form control elements do not inherit `text-transform` values.
|
|
122
|
+
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
|
123
|
+
* Correct `select` style inheritance in Firefox.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
button,
|
|
127
|
+
select {
|
|
128
|
+
text-transform: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
|
133
|
+
* and `video` controls.
|
|
134
|
+
* 2. Correct inability to style clickable `input` types in iOS.
|
|
135
|
+
* 3. Improve usability and consistency of cursor style between image-type
|
|
136
|
+
* `input` and others.
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
button,
|
|
140
|
+
html input[type="button"], /* 1 */
|
|
141
|
+
input[type="reset"],
|
|
142
|
+
input[type="submit"] {
|
|
143
|
+
-webkit-appearance: button; /* 2 */
|
|
144
|
+
cursor: pointer; /* 3 */
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Re-set default cursor for disabled elements.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
button[disabled],
|
|
152
|
+
html input[disabled] {
|
|
153
|
+
cursor: default;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Remove inner padding and border in Firefox 4+.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
button::-moz-focus-inner,
|
|
161
|
+
input::-moz-focus-inner {
|
|
162
|
+
border: 0;
|
|
163
|
+
padding: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
|
168
|
+
* the UA stylesheet.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
input {
|
|
172
|
+
line-height: normal;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* It's recommended that you don't attempt to style these elements.
|
|
177
|
+
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
|
178
|
+
*
|
|
179
|
+
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
|
180
|
+
* 2. Remove excess padding in IE 8/9/10.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
input[type="checkbox"],
|
|
184
|
+
input[type="radio"] {
|
|
185
|
+
box-sizing: border-box; /* 1 */
|
|
186
|
+
padding: 0; /* 2 */
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
|
191
|
+
* `font-size` values of the `input`, it causes the cursor style of the
|
|
192
|
+
* decrement button to change from `default` to `text`.
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
196
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
197
|
+
height: auto;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
|
|
202
|
+
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
|
|
203
|
+
* (include `-moz` to future-proof).
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
input[type="search"] {
|
|
207
|
+
-webkit-appearance: textfield; /* 1 */
|
|
208
|
+
-moz-box-sizing: content-box;
|
|
209
|
+
-webkit-box-sizing: content-box; /* 2 */
|
|
210
|
+
box-sizing: content-box;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
|
215
|
+
* Safari (but not Chrome) clips the cancel button when the search input has
|
|
216
|
+
* padding (and `textfield` appearance).
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
input[type="search"]::-webkit-search-cancel-button,
|
|
220
|
+
input[type="search"]::-webkit-search-decoration {
|
|
221
|
+
-webkit-appearance: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Tables
|
|
225
|
+
========================================================================== */
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Remove most spacing between table cells.
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
table {
|
|
232
|
+
border-collapse: collapse;
|
|
233
|
+
border-spacing: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
td,
|
|
237
|
+
th {
|
|
238
|
+
padding: 0;
|
|
239
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = (app, router) => {
|
|
2
|
+
const { project: projectController } = app.controller;
|
|
3
|
+
router.get("/api/project", projectController.get.bind(projectController));
|
|
4
|
+
router.get(
|
|
5
|
+
"/api/project/list",
|
|
6
|
+
projectController.getList.bind(projectController),
|
|
7
|
+
);
|
|
8
|
+
router.get(
|
|
9
|
+
"/api/project/model_list",
|
|
10
|
+
projectController.getModelList.bind(projectController),
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
module.exports = (app, router) => {
|
|
2
|
+
const { view: viewController } = app.controller;
|
|
3
|
+
|
|
4
|
+
//用户输入 http://ip:port/view/xxx 能渲染对应的页面
|
|
5
|
+
router.get("/view/:page", viewController.renderPage.bind(viewController));
|
|
6
|
+
router.get("/view/:page/*", viewController.renderPage.bind(viewController));
|
|
7
|
+
};
|