@@ -66,10 +66,10 @@ export function get(url: string, data = {}, options = {}) { | |||
const defaultOptions = { | |||
url: url, | |||
method: "get", | |||
params: data, | |||
params: data | |||
} | |||
//合并用户配置参数信息 | |||
options = mergeOptions(defaultOptions, options); | |||
options = Object.assign(defaultOptions, options) | |||
return common(options) | |||
} | |||
@@ -87,7 +87,7 @@ export function get(url: string, data = {}, options = {}) { | |||
params: data, | |||
} | |||
//合并用户配置参数信息 | |||
options = mergeOptions(defaultOptions, options); | |||
options = Object.assign(defaultOptions, options); | |||
return common(options) | |||
} | |||
@@ -0,0 +1,15 @@ | |||
function uploadFile(file) { | |||
// if ((objfile.size / 1024 / 1024) > 0) { | |||
// console.log("文件不能大于1MB"); | |||
// return false; | |||
// } | |||
// console.log(this.$refs.upload.files[0]); | |||
// if (objfile.type != "image/jpeg" || objfile.type != "image/png") { | |||
// console.log("文件只能是jpg或者png格式"); | |||
// return false; | |||
// } | |||
var formData = new FormData(); | |||
formData.append('file', file); | |||
return formData; | |||
} |
@@ -7,7 +7,7 @@ export const Data = { | |||
table: { | |||
style: '', | |||
customDialog: true, //自定义Dialog (默认false) | |||
footerDialog: true, | |||
footerDialog: true, //是否隐藏Dialog页脚 | |||
extend: [{ | |||
type: 'index', | |||
label: '序号', | |||
@@ -15,7 +15,7 @@ export const Data = { | |||
}], | |||
field: [ //表格 | |||
{ | |||
prop: 'one', | |||
prop: 'userName', | |||
label: '客户名称', | |||
width: '120', | |||
overflow: true, | |||
@@ -43,7 +43,7 @@ export const Data = { | |||
placeholder: '请输入车牌颜色' | |||
} | |||
}, { | |||
prop: 'four', | |||
prop: 'cardId', | |||
label: '卡号', | |||
width: '200', | |||
form: { | |||
@@ -52,7 +52,7 @@ export const Data = { | |||
placeholder: '卡号' | |||
} | |||
}, { | |||
prop: 'five', | |||
prop: 'cardStatus', | |||
label: '卡片状态', | |||
width: '120', | |||
form: { | |||
@@ -69,8 +69,8 @@ export const Data = { | |||
type: 'input', | |||
placeholder: '请输入卡片类型' | |||
} | |||
},{ | |||
prop: 'seven', | |||
}, { | |||
prop: 'obuId', | |||
label: 'OBU编号', | |||
width: '200', | |||
form: { | |||
@@ -79,7 +79,7 @@ export const Data = { | |||
placeholder: 'OBU编号' | |||
} | |||
}, { | |||
prop: 'eight', | |||
prop: 'obuStatus', | |||
label: 'OBU状态', | |||
width: '120', | |||
form: { |
@@ -63,9 +63,11 @@ | |||
function closeTabs() { | |||
if (data.indexes !== -1) { | |||
nextTick(() => { | |||
const tabs = editableTabs.value | |||
$storeTab.dispatch('removeTab', data.indexes) | |||
const tabDatas = editableTabs.value[editableTabs.value.length - 1] | |||
sessionStorage.setItem('newTab', JSON.stringify(tabDatas)) | |||
router.replace({name: tabs[editableTabs.value.length - 1].path}) | |||
}) | |||
} | |||
} |
@@ -10,8 +10,9 @@ | |||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> | |||
</el-select> | |||
</template> | |||
<!-- 自定义编辑提交按钮 --> | |||
<template #operation="{ scope , tableFrom}"> | |||
<template #operation="{ scope , tableFrom }"> | |||
<el-button size="small" @click="reissue(scope,tableFrom)">补卡</el-button> | |||
</template> | |||
<!-- 自定义弹框内容 --> | |||
@@ -50,6 +51,25 @@ | |||
ref, | |||
reactive | |||
} from 'vue' | |||
import { | |||
useRequest | |||
} from 'vue-request'; | |||
import axios from 'axios'; | |||
import { | |||
getCurrentInstance | |||
} from 'vue' | |||
const { | |||
proxy | |||
} = getCurrentInstance(); | |||
proxy.$request.get('api/user', {}, { | |||
baseURL: 'http://192.168.1.101:8080' | |||
}).then((res) => { | |||
console.log(res); | |||
}).catch((err) => { | |||
console.log(err); | |||
}) | |||
const datas = reactive(Data); | |||
const crudRef = ref() |
@@ -1,9 +1,34 @@ | |||
<template> | |||
<!-- <CRUD @add="add"></CRUD> --> | |||
</template> | |||
<!-- accept 限制上传文件格式 .text--> | |||
<el-upload ref="uploadRef" class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" | |||
on-progress="progress" :auto-upload="false"> | |||
<template #trigger> | |||
<el-button type="primary">select file</el-button> | |||
</template> | |||
<el-button class="ml-3" type="success" @click="submitUpload"> | |||
upload to server | |||
</el-button> | |||
<template #tip> | |||
<div class="el-upload__tip"> | |||
jpg/png files with a size less than 500kb | |||
</div> | |||
</template> | |||
</el-upload> | |||
</template> | |||
<script lang="ts" setup> | |||
import CRUD from "@/crud/index.vue"; | |||
import { | |||
ref | |||
} from 'vue' | |||
const uploadRef = ref() | |||
const submitUpload = () => { | |||
uploadRef.value.submit() | |||
} | |||
function add() {} | |||
const progress = (evt, uploadFile, uploadFiles) => { | |||
console.log(evt, uploadFile, uploadFiles); | |||
} | |||
</script> |
@@ -15,5 +15,5 @@ | |||
}, | |||
"types": ["element-plus/global"] //指定全局组件类型 | |||
}, | |||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] | |||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/api/system/commonApi.js"] | |||
} |