Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #61

Merged
merged 14 commits into from
Dec 9, 2021
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx
FROM nginx:1.20.0
COPY nginx.conf /etc/nginx/nginx.conf
COPY dist/ /usr/share/nginx/html/
COPY replace.sh /
Expand Down
17 changes: 12 additions & 5 deletions src/assets/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,26 @@ body,

.remote-tab {
border: 1px solid #EBEEF5 !important;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.remote-tab .el-tabs__item{
.remote-tab .el-tabs__item {
border-bottom: 1px solid #EBEEF5 !important;
padding: 0 15px;
color: #606266 !important;
}

.remote-tab .el-tabs__content{
.remote-tab .el-tabs__item.is-active {
border-bottom: 1px solid #EBEEF5 !important;
padding: 0 15px;
color: #409EFF !important;
}

.remote-tab .el-tabs__content {
padding: 15px;
border-left: 1px solid #EBEEF5;
}

.remote-tab .el-tabs__header{
margin-right: 0px!important;
.remote-tab .el-tabs__header {
margin-right: 0px !important;
}
Binary file added src/assets/img/HTC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/Lenovo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/components/ElementSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ const pageData = ref({
});
const pageSize = ref(10);
const currentPage = ref(0)
const findByName = (name) => {
props.step.elements[props.index] = null
axios.get("/controller/elements/list", {
params: {
name,
projectId: props.projectId,
type: props.type,
page: 1,
pageSize: pageSize.value,
}
}).then(resp => {
pageData.value = resp.data
currentPage.value = pageData.value['number'] + 1
})
}
const findByProjectIdAndEleType = (event, pageNum, pSize) => {
if (event) {
props.step.elements[props.index] = null
Expand Down Expand Up @@ -46,19 +61,25 @@ onMounted(() => {
:prop="'elements['+index+']'"
>
<el-select
filterable
remote
:remote-method="findByName"
value-key="id"
v-model="step.elements[index]"
:placeholder="place"
placeholder="请输入控件名称筛选"
@visible-change="findByProjectIdAndEleType"
>
<el-option
v-if="pageData['content']!==null"
v-for="item in pageData['content']"
:key="item.id"
:label="item['eleName']"
:value="item"
></el-option>
<div style="text-align: center;margin-top: 5px">
<el-pagination small layout="prev, pager, next"
hide-on-single-page
v-model:current-page="currentPage"
:total="pageData['totalElements']"
:page-size="pageSize"
Expand Down
3 changes: 2 additions & 1 deletion src/components/RenderStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ const statusList = {
const props = defineProps(
{
status: String,
user: String
}
);
const selObj = statusList[props.status] || {type: 'danger', text: '加载中'}
</script>

<template>
<el-tag :type="selObj.type" size="mini" style="float: right">
{{ selObj.text }}
{{ status === 'DEBUGGING' ? user + " " + selObj.text : selObj.text }}
</el-tag>
</template>
65 changes: 53 additions & 12 deletions src/views/Devices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const manufacturer = ref([
"Yulong",
"LGE",
"Sony",
"GIONEE"
"GIONEE",
"Lenovo",
"HTC"
]);
const statusList = ref([
{
Expand Down Expand Up @@ -295,9 +297,12 @@ const getAllAgents = () => {
agentList.value = resp.data
})
}
const savePwd = (device) => {
const saveDetail = (device) => {
axios
.put("/controller/devices/savePwd", {id: device.id, password: device.password}).then((resp) => {
.put("/controller/devices/saveDetail", {
id: device.id, password: device.password,
nickName: device.nickName
}).then((resp) => {
if (resp['code'] === 2000) {
ElMessage.success({
message: resp['message'],
Expand Down Expand Up @@ -370,7 +375,18 @@ const updateImg = (id, imgUrl) => {
}
});
}
const getFilterOption = () => {
axios
.get("/controller/devices/getFilterOption")
.then((resp) => {
if (resp['code'] === 2000) {
cpus.value =resp['data'].cpu
sizes.value =resp['data'].size
}
});
}
onMounted(() => {
getFilterOption();
findAll();
getAllAgents();
})
Expand Down Expand Up @@ -470,7 +486,7 @@ onMounted(() => {
:src="getImg(man)"
/>
<img
v-else-if="man === 'Xiaomi' ||man === 'APPLE'|| man==='LGE'"
v-else-if="man === 'Xiaomi' ||man === 'APPLE'|| man==='LGE' || man==='HTC'"
style="width: 30px"
:src="getImg(man)"
/>
Expand Down Expand Up @@ -562,11 +578,11 @@ onMounted(() => {
>
<template #header>
<span v-if="device.model">{{
device.model.length > 25
? device.model.substring(0, 17) + "..."
(device['nickName'] && device['nickName'].length > 0)
? device['nickName']
: device.model
}}</span>
<RenderStatus :status="device.status"></RenderStatus>
<RenderStatus :status="device.status" :user="device.user"></RenderStatus>
</template>
<el-row>
<el-col :span="10">
Expand Down Expand Up @@ -597,6 +613,14 @@ onMounted(() => {
label-width="70px"
style="margin: 0 0 15px 10px"
>
<el-form-item label="设备型号" v-if="device.model">
<div>{{
device.model.length > 25
? device.model.substring(0, 17) + "..."
: device.model
}}
</div>
</el-form-item>
<el-form-item label="设备名称">
<div>{{ device.name }}</div>
</el-form-item>
Expand All @@ -609,7 +633,7 @@ onMounted(() => {
:src="getImg(device.manufacturer)"
/>
<img
v-else-if="device.manufacturer === 'Xiaomi' ||device.manufacturer === 'APPLE'||device.manufacturer === 'LGE'"
v-else-if="device.manufacturer === 'Xiaomi' ||device.manufacturer === 'APPLE'||device.manufacturer === 'LGE'||device.manufacturer === 'HTC'"
style="width: 30px"
:src="getImg(device.manufacturer)"
/>
Expand All @@ -629,9 +653,6 @@ onMounted(() => {
<el-form-item label="系统版本">
<div>{{ device.version }}</div>
</el-form-item>
<el-form-item label="分辨率">
<div>{{ device.size }}</div>
</el-form-item>
<el-form-item label="所在位置">
<div>{{ findAgentById(device.agentId) }}</div>
</el-form-item>
Expand Down Expand Up @@ -667,6 +688,26 @@ onMounted(() => {
>
</el-upload>
</el-form-item>
<el-form-item label="设备备注">
<el-input
show-word-limit
v-model="device['nickName']"
type="text"
size="mini"
placeholder="输入设备备注信息"
maxlength="30"
style="position: absolute; top: 7px; bottom: 7px"
>
<template #append>
<el-button
size="mini"
@click="saveDetail(device)"
>保存
</el-button
>
</template>
</el-input>
</el-form-item>
<el-form-item label="设备名称">
<span>{{ device.name }}</span>
</el-form-item>
Expand Down Expand Up @@ -695,7 +736,7 @@ onMounted(() => {
<template #append>
<el-button
size="mini"
@click="savePwd(device)"
@click="saveDetail(device)"
>保存
</el-button
>
Expand Down
5 changes: 5 additions & 0 deletions src/views/ProjectIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ const getData = () => {
})
}
onMounted(() => {
let chart = echarts.getInstanceByDom(document.getElementById('projectChart'));
if (chart == null) {
chart = echarts.init(document.getElementById('projectChart'));
}
chart.dispose();
const end = moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
const start = moment(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7)).format("YYYY-MM-DD HH:mm:ss")
times.value = [start, end];
Expand Down
Loading