| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <el-select v-model="jobId" value-key="jobId" style="width: 100%" filterable placeholder="请选择派发频次">
- <el-option-group>
- <el-option
- v-for="item in jobList"
- :key="item.jobId"
- :label="item.cycleTitle"
- :value="item.jobId"
- />
- </el-option-group>
- </el-select>
- </template>
- <script>
- import { getActiveJobByList } from '@/api/system/jobApi'
- export default {
- name: 'JobSelector',
- components: { },
- props: {
- value: {
- type: Number,
- default: undefined
- },
- jobClassId: {
- type: Number,
- default: undefined
- }
- },
- data() {
- return {
- jobId: undefined,
- jobList: [],
- conditions: {
- jobClassId: this.jobClassId
- }
- }
- },
- watch: {
- value(val) {
- this.jobId = val
- },
- jobId(val) {
- this.$emit('input', val)
- }
- },
- created() {
- this.initJobData()
- },
- mounted() {},
- methods: {
- // Job列表
- initJobData() {
- getActiveJobByList(this.conditions).then((resp) => {
- const { data } = resp
- this.jobList = data
- }).catch((error) => {
- console.log(error)
- })
- }
- }
- }
- </script>
|