| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | |
| | | import {listOfSpotTypesApi,spotTypesCreateApi,editSpotTypeApi,deleteSpotTypeApi} from '@/api/patchManagement/index' |
| | | import {searchManagementApi,listOfSpotTypesApi,spotTypesCreateApi,editSpotTypeApi,deleteSpotTypeApi} from '@/api/patchManagement/index' |
| | | import { ref, computed, watch } from 'vue' |
| | | import { getListPage, getDetail, add, remove, enable, disable } from '@/api/resource/oss' |
| | | import { enable, disable } from '@/api/resource/oss' |
| | | import { useStore } from 'vuex' |
| | | import func from '@/utils/func' |
| | | import { useRouter } from 'vue-router' |
| | | import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'; |
| | | const store = useStore() |
| | | const router = useRouter() |
| | | |
| | | // ---------------- data ---------------- |
| | | const form = ref({}) |
| | | const query = ref({}) |
| | | const creatorOption = ref([]); |
| | | const loading = ref(true) |
| | | const page = ref({ |
| | | pageSize: 20, |
| | | currentPage: 1, |
| | | total: 0, |
| | | lotValue:"", |
| | | createUser:'' |
| | | userName:'' |
| | | }) |
| | | |
| | | const selectionList = ref([]) |
| | | const option = ref({ |
| | | addBtn: true, |
| | |
| | | searchShow: true, |
| | | searchMenuSpan: 16, |
| | | searchMenuPosition: 'right', |
| | | border: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | grid: false, |
| | |
| | | column: [ |
| | | { |
| | | label: '类型名称', |
| | | prop: 'lot_value', |
| | | prop: 'patches_type', |
| | | search: true, |
| | | searchSpan: 4, |
| | | rules: [ |
| | |
| | | label: '创建时间', |
| | | prop: 'create_time', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | rules: [ |
| | | { required: true, message: '请输入创建时间', trigger: 'blur' }, |
| | | ], |
| | |
| | | prop: 'user_name', |
| | | search: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | searchSpan: 4, |
| | | type: 'select', |
| | | dicData: creatorOption, |
| | | props: { |
| | | label: 'label', |
| | | value: 'value', |
| | | }, |
| | | rules: [ |
| | | { required: true, message: '请输入创建人', trigger: 'blur' }, |
| | | ], |
| | |
| | | }) |
| | | |
| | | const data = ref([]) |
| | | |
| | | // 获取搜索数据 |
| | | const getsearchManagementApi = () => { |
| | | searchManagementApi().then(res => { |
| | | creatorOption.value = res.data.data.user_names.map(item => ({ |
| | | label: item, |
| | | value: item, |
| | | })); |
| | | |
| | | }); |
| | | }; |
| | | |
| | | |
| | | // ---------------- watch ---------------- |
| | |
| | | // ---------------- methods ---------------- |
| | | const rowSave = (row, done, loadingFn) => { |
| | | const createParams ={ |
| | | lot_value:row.lot_value, |
| | | patches_type:row.patches_type |
| | | , |
| | | } |
| | | console.log('row',row); |
| | | |
| | | spotTypesCreateApi(createParams).then( |
| | | () => { |
| | | onLoad(page.value) |
| | |
| | | } |
| | | |
| | | const searchReset = () => { |
| | | page.value.createUser='' |
| | | page.value.userName='' |
| | | page.value.lotValue ='' |
| | | page.value.currentPage=1 |
| | | page.value.pageSize=20 |
| | |
| | | } |
| | | |
| | | const searchChange = (params, done) => { |
| | | console.log('list',params); |
| | | |
| | | page.value.currentPage = 1 |
| | | page.value.lotValue = params.lot_value |
| | | page.value.createUser = params.user_name |
| | | page.value.lotValue = params.patches_type |
| | | page.value.userName = params.user_name |
| | | onLoad(page.value) |
| | | done() |
| | | } |
| | |
| | | current:pageParam.currentPage, |
| | | size:pageParam.pageSize, |
| | | lotValue:pageParam.lotValue, |
| | | createUser:pageParam.createUser |
| | | userName:pageParam.userName |
| | | } |
| | | loading.value = true |
| | | listOfSpotTypesApi(searchparams).then(res => { |
| | | const resData = res.data.data |
| | | console.log('列表',resData.records); |
| | | |
| | | page.value.total = resData.total |
| | | data.value = resData.records |
| | | loading.value = false |
| | |
| | | router.push({ path: '/resource/patchManagement' }) |
| | | } |
| | | |
| | | const addPatchType = () => { |
| | | // TODO: 新增图斑类型逻辑 |
| | | } |
| | | |
| | | // ---------------- utils ---------------- |
| | | function validData (value) { |
| | | return value !== undefined && value !== null && value !== false |
| | | } |
| | | |
| | | function findObject (list, prop) { |
| | | return list.find(item => item.prop === prop) |
| | | } |
| | | |
| | | const crudRef = ref(null) |
| | | onMounted(() => { |
| | | getsearchManagementApi(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |