Browse Source

发布任务准备

master
maochaoying 2 years ago
parent
commit
e55255837e
  1. 7
      src/api/info.js
  2. 43
      src/components/Publish.vue
  3. 4
      src/pages/index.vue

7
src/api/info.js

@ -14,6 +14,13 @@ export const coreListApi = () => {
})
}
export const coreListByStationIdApi = id => {
return request({
url: `/core/list/${id}`,
method: 'GET',
})
}
export const addStationApi = data => {
return request({
url: '/station/add',

43
src/components/Publish.vue

@ -28,15 +28,16 @@
class="demo-select-base"
clearable
filterable
@change="handleStationChange"
placeholder="请选择所在核电站"
>
<t-option
v-for="(item, index) in stationList"
:value="item.value"
:label="item.label"
:key="index"
v-for="item in stationList"
:value="item.id"
:label="item.name"
:key="item.id"
>
{{ item.label }}
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
@ -49,12 +50,12 @@
placeholder="请选择所在核芯堆"
>
<t-option
v-for="(item, index) in coreList"
:value="item.value"
:label="item.label"
:key="index"
v-for="item in coreList"
:value="item.id"
:label="item.name"
:key="item.id"
>
{{ item.label }}
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
@ -88,6 +89,7 @@
</template>
<script>
import { allOperatorApi } from '@/api/publish'
import { stationListApi, coreListByStationIdApi } from '@/api/info'
const INITIAL_DATA = {
taskname: '',
order: '',
@ -99,11 +101,7 @@ export default {
data() {
return {
formData: { ...INITIAL_DATA },
stationList: [
{ label: '计算机学院', value: '1' },
{ label: '软件学院', value: '2' },
{ label: '物联网学院', value: '3' },
],
stationList: [],
userList: [],
coreList: [],
rules: {
@ -132,6 +130,18 @@ export default {
},
methods: {
async handleStationChange(value, context) {
const res = await coreListByStationIdApi(value)
if (res?.code == 200) {
this.coreList = res?.data.list
}
},
async getStationList() {
const res = await stationListApi()
if (res?.code == 200) {
this.stationList = res?.data?.list
}
},
async getAllOperator() {
const res = await allOperatorApi()
if (res?.code == 200) {
@ -140,13 +150,11 @@ export default {
},
onReset() {
this.$message.success('重置成功')
console.log('formData', this.formData)
},
onSubmit({ validateResult, firstError }) {
if (validateResult === true) {
this.$message.success('提交成功')
} else {
console.log('Errors: ', validateResult)
this.$message.warning(firstError)
}
},
@ -154,6 +162,7 @@ export default {
mounted() {
this.getAllOperator()
this.getStationList()
},
}
</script>

4
src/pages/index.vue

@ -106,7 +106,7 @@
</svg>
<p class="title">用户管理</p>
</div>
<div class="menu" @click="changePage(4)" v-if="role == 'ROLE_ADMIN'">
<!-- <div class="menu" @click="changePage(4)" v-if="role == 'ROLE_ADMIN'">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
@ -126,7 +126,7 @@
</g>
</svg>
<p class="title">相机调试</p>
</div>
</div> -->
<div class="menu" @click="changePage(5)" v-if="role == 'ROLE_ADMIN'">
<svg
xmlns="http://www.w3.org/2000/svg"

Loading…
Cancel
Save