Browse Source

finish

master
maochaoying 2 years ago
parent
commit
6a2b94622c
  1. 25
      src/components/DetailTable.vue
  2. 28
      src/components/Nuclear.vue
  3. 145
      src/components/Task.vue
  4. 2
      src/pages/index.vue

25
src/components/DetailTable.vue

@ -42,7 +42,14 @@ const columns = ref([
width: 120, width: 120,
cell: (h, { row }) => cell: (h, { row }) =>
row.firstSign && row.secondSign ? ( row.firstSign && row.secondSign ? (
<div>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'center',
}}
>
<p>{row.firstSign?.substr(-4)}</p> <p>{row.firstSign?.substr(-4)}</p>
<p>{row.secondSign?.substr(-4)}</p> <p>{row.secondSign?.substr(-4)}</p>
</div> </div>
@ -56,7 +63,13 @@ const columns = ref([
cell: (h, { row }) => { cell: (h, { row }) => {
if (row.result == 1) { if (row.result == 1) {
return ( return (
<div>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<p>{row.resultSerial}</p> <p>{row.resultSerial}</p>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -121,7 +134,13 @@ const columns = ref([
) )
} else if (row.result == 2) { } else if (row.result == 2) {
return ( return (
<div>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<p>{row.resultSerial}</p> <p>{row.resultSerial}</p>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

28
src/components/Nuclear.vue

@ -3,12 +3,14 @@
<t-tabs :value="tabValue" @change="newValue => (tabValue = newValue)"> <t-tabs :value="tabValue" @change="newValue => (tabValue = newValue)">
<t-tab-panel value="first" label="核电站信息管理"> <t-tab-panel value="first" label="核电站信息管理">
<div style="padding: 25px"> <div style="padding: 25px">
<t-button
style="margin-bottom: 25px"
theme="primary"
@click="stationVisible = true"
>新增核电站</t-button
>
<div style="display: flex; justify-content: flex-end">
<t-button
style="margin-bottom: 25px"
theme="primary"
@click="stationVisible = true"
>新增核电站</t-button
>
</div>
<t-dialog <t-dialog
header="新增核电站" header="新增核电站"
:visible="stationVisible" :visible="stationVisible"
@ -60,12 +62,14 @@
</t-tab-panel> </t-tab-panel>
<t-tab-panel value="second" label="堆芯信息管理"> <t-tab-panel value="second" label="堆芯信息管理">
<div style="padding: 25px"> <div style="padding: 25px">
<t-button
theme="primary"
style="margin-bottom: 25px"
@click="coreVisible = true"
>新增堆芯</t-button
>
<div style="display: flex; justify-content: flex-end">
<t-button
theme="primary"
style="margin-bottom: 25px"
@click="coreVisible = true"
>新增堆芯</t-button
>
</div>
<t-dialog <t-dialog
header="新增堆芯" header="新增堆芯"
:visible="coreVisible" :visible="coreVisible"

145
src/components/Task.vue

@ -216,42 +216,26 @@ export default {
width: 120, width: 120,
cell: (h, { row }) => { cell: (h, { row }) => {
if (row.status == 0) { if (row.status == 0) {
if (this.role == 'ROLE_ADMIN') {
return (
<div class="not_start_table_btn">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="24"
height="23.999755859375"
viewBox="0 0 24 23.999755859375"
>
<g>
<path
d="M12,0C18.6275,0,24,5.37245,24,11.9999C24,18.6273,18.6275,23.9998,12,23.9998C5.3725,23.9998,0,18.6273,0,11.9999C0,5.37245,5.3725,0,12,0ZM12,16.1103C10.9964,16.1103,10.1827,16.9238,10.1827,17.9276C10.1827,18.9312,10.9964,19.7449,12,19.7449C13.0036,19.7449,13.8173,18.9312,13.8173,17.9276C13.8173,16.9238,13.0036,16.1103,12,16.1103ZM11.9477,14.6896C12.8122,14.6896,13.5129,13.9887,13.5129,13.1245L13.5129,5.82005C13.5129,4.95557,12.8122,4.25489,11.9477,4.25489C11.0833,4.25489,10.3826,4.95581,10.3826,5.82005L10.3826,13.1245C10.3826,13.9889,11.0833,14.6896,11.9477,14.6896Z"
fill="#FFFFFF"
fill-opacity="1"
/>
</g>
</svg>
<span>未开始</span>
</div>
)
}
return ( return (
<div
class={
row.canUpload
? 'start_table_btn disable_table_btn'
: 'start_table_btn'
}
onClick={() =>
this.startTask(row, row.nuclearCoreName, 1, row.canUpload)
}
>
开始任务
<div class="not_start_table_btn">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="24"
height="23.999755859375"
viewBox="0 0 24 23.999755859375"
>
<g>
<path
d="M12,0C18.6275,0,24,5.37245,24,11.9999C24,18.6273,18.6275,23.9998,12,23.9998C5.3725,23.9998,0,18.6273,0,11.9999C0,5.37245,5.3725,0,12,0ZM12,16.1103C10.9964,16.1103,10.1827,16.9238,10.1827,17.9276C10.1827,18.9312,10.9964,19.7449,12,19.7449C13.0036,19.7449,13.8173,18.9312,13.8173,17.9276C13.8173,16.9238,13.0036,16.1103,12,16.1103ZM11.9477,14.6896C12.8122,14.6896,13.5129,13.9887,13.5129,13.1245L13.5129,5.82005C13.5129,4.95557,12.8122,4.25489,11.9477,4.25489C11.0833,4.25489,10.3826,4.95581,10.3826,5.82005L10.3826,13.1245C10.3826,13.9889,11.0833,14.6896,11.9477,14.6896Z"
fill="#FFFFFF"
fill-opacity="1"
/>
</g>
</svg>
<span>未开始</span>
</div> </div>
) )
} else if (row.status == 1) { } else if (row.status == 1) {
@ -264,22 +248,14 @@ export default {
</div> </div>
) )
} else if (row.status == 2) { } else if (row.status == 2) {
if (this.role == 'ROLE_ADMIN') {
return (
<div class="process_table_btn continue_table_btn">
任务暂停
</div>
)
} else {
return (
<div
class="continue_table_btn"
onClick={() => this.startTask(row, row.nuclearCoreName)}
>
继续任务
</div>
)
}
return (
<div
class="process_table_btn continue_table_btn"
style={{ cursor: 'default' }}
>
任务暂停
</div>
)
} else { } else {
return ( return (
<div class="finished_table_btn"> <div class="finished_table_btn">
@ -412,24 +388,55 @@ export default {
) )
} else { } else {
return ( return (
<div
onClick={() =>
this.viewDetail(
row.id,
row.nuclearCoreName,
1,
row.nuclearStationName,
row.operatorName,
row.canUpload,
)
}
class={
row.canUpload
? 'start_table_btn disable_table_btn'
: 'start_table_btn'
}
>
查看详情
<div style={{ display: 'flex' }}>
{row.status == 2 && this.role == 'ROLE_USER' ? (
<div
class="continue_table_btn"
style={{ marginRight: '10px' }}
onClick={() => this.startTask(row, row.nuclearCoreName)}
>
继续任务
</div>
) : null}
{row.status == 0 && this.role == 'ROLE_USER' ? (
<div
style={{ marginRight: '10px' }}
class={
row.canUpload
? 'start_table_btn disable_table_btn'
: 'start_table_btn'
}
onClick={() =>
this.startTask(
row,
row.nuclearCoreName,
1,
row.canUpload,
)
}
>
开始任务
</div>
) : null}
<div
onClick={() =>
this.viewDetail(
row.id,
row.nuclearCoreName,
1,
row.nuclearStationName,
row.operatorName,
row.canUpload,
)
}
class={
row.canUpload
? 'start_table_btn disable_table_btn'
: 'start_table_btn'
}
>
查看详情
</div>
</div> </div>
) )
} }

2
src/pages/index.vue

@ -1015,7 +1015,7 @@ initWebSocket()
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.progress_btn { .progress_btn {
padding: 25px 24px 18px 0;
padding: 25px 24px 18px 24px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;

Loading…
Cancel
Save