| | |
| | | <el-tag>{{ row.categoryName }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="对象存储上传调试" append-to-body v-model="box" width="550px"> |
| | | <avue-form ref="form" :option="debugOption" v-model="debugForm" @submit="handleSubmit" /> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | const form = ref({}) |
| | | const query = ref({}) |
| | | const loading = ref(true) |
| | | const box = ref(false) |
| | | |
| | | const page = ref({ |
| | | pageSize: 20, |
| | | currentPage: 1, |
| | | total: 0, |
| | | lotValue:"", |
| | | createUser:'' |
| | | }) |
| | | |
| | | const selectionList = ref([]) |
| | |
| | | { |
| | | label: '创建时间', |
| | | prop: 'create_time', |
| | | addDisplay: false, |
| | | rules: [ |
| | | { required: true, message: '请输入创建时间', trigger: 'blur' }, |
| | | ], |
| | |
| | | label: '创建人', |
| | | prop: 'user_name', |
| | | search: true, |
| | | addDisplay: false, |
| | | searchSpan: 4, |
| | | rules: [ |
| | | { required: true, message: '请输入创建人', trigger: 'blur' }, |
| | |
| | | |
| | | const data = ref([]) |
| | | |
| | | const debugForm = ref({ |
| | | code: '', |
| | | }) |
| | | |
| | | const debugOption = ref({ |
| | | submitText: '提交', |
| | | column: [ |
| | | { |
| | | label: '资源编号', |
| | | prop: 'code', |
| | | disabled: true, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: '上传背景', |
| | | prop: 'backgroundUrl', |
| | | type: 'upload', |
| | | listType: 'picture-img', |
| | | dataType: 'string', |
| | | action: '/blade-resource/oss/endpoint/put-file', |
| | | propsHttp: { res: 'data', url: 'link' }, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }) |
| | | |
| | | // ---------------- watch ---------------- |
| | | watch( |
| | |
| | | } |
| | | ) |
| | | |
| | | watch( |
| | | () => debugForm.value.code, |
| | | () => { |
| | | const column = findObject(debugOption.value.column, 'backgroundUrl') |
| | | column.action = `/blade-resource/oss/endpoint/put-file?code=${debugForm.value.code}` |
| | | } |
| | | ) |
| | | |
| | | |
| | | // ---------------- computed ---------------- |
| | | const permission = computed(() => store.getters.permission) |
| | |
| | | |
| | | // ---------------- methods ---------------- |
| | | const rowSave = (row, done, loadingFn) => { |
| | | const createParams ={ |
| | | lot_value:row.lot_value, |
| | | } |
| | | console.log('row',row); |
| | | |
| | | // spotTypesCreateApi(row).then( |
| | | // () => { |
| | | // onLoad(page.value) |
| | | // ElMessage.success('操作成功!') |
| | | // done() |
| | | // }, |
| | | // error => { |
| | | // console.log(error) |
| | | // loadingFn() |
| | | // } |
| | | // ) |
| | | spotTypesCreateApi(createParams).then( |
| | | () => { |
| | | onLoad(page.value) |
| | | ElMessage.success('操作成功!') |
| | | done() |
| | | }, |
| | | error => { |
| | | console.log(error) |
| | | loadingFn() |
| | | } |
| | | ) |
| | | } |
| | | |
| | | const rowUpdate = (row, index, done, loadingFn) => { |
| | | console.log('row',row); |
| | | |
| | | editSpotTypeApi(row).then( |
| | | (res) => { |
| | | console.log('res',res); |
| | | |
| | | onLoad(page.value) |
| | | ElMessage.success('操作成功!') |
| | | done() |
| | |
| | | } |
| | | |
| | | const searchReset = () => { |
| | | query.value = {} |
| | | page.value.createUser='' |
| | | page.value.lotValue ='' |
| | | page.value.currentPage=1 |
| | | page.value.pageSize=20 |
| | | onLoad(page.value) |
| | | } |
| | | |
| | | const searchChange = (params, done) => { |
| | | console.log('list',params); |
| | | query.value = params |
| | | |
| | | page.value.currentPage = 1 |
| | | onLoad(page.value, params) |
| | | page.value.lotValue = params.lot_value |
| | | page.value.createUser = params.user_name |
| | | onLoad(page.value) |
| | | done() |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | const handleDebug = row => { |
| | | box.value = true |
| | | debugForm.value.code = row.ossCode |
| | | debugForm.value.backgroundUrl = '' |
| | | } |
| | | |
| | | const handleSubmit = (form, done) => { |
| | | ElMessage.success(`获取到图片地址:[${form.backgroundUrl}]`) |
| | | done() |
| | | } |
| | | |
| | | const beforeOpen = (done, type) => { |
| | | // if (['edit', 'view'].includes(type)) { |
| | |
| | | const onLoad = (pageParam, params = {}) => { |
| | | const searchparams ={ |
| | | current:pageParam.currentPage, |
| | | size:pageParam.pageSize |
| | | size:pageParam.pageSize, |
| | | lotValue:pageParam.lotValue, |
| | | createUser:pageParam.createUser |
| | | } |
| | | loading.value = true |
| | | listOfSpotTypesApi(searchparams).then(res => { |