fix: 修复typescript一些编译报错

This commit is contained in:
郝先瑞
2022-01-21 00:26:24 +08:00
parent 9e15f53869
commit bcade4177e
11 changed files with 36 additions and 29 deletions

View File

@@ -11,16 +11,16 @@
:limit="1"
:http-request="uploadImage"
>
<img v-if="imgUrl" :src="imgUrl" class="avatar"/>
<img v-if="imgURL" :src="imgURL" class="avatar"/>
<el-icon v-else class="avatar-uploader-icon">
<Plus/>
</el-icon>
<el-icon
v-if="imgUrl"
v-if="imgURL"
class="remove-icon"
@click.stop="handleRemove(imgUrl)"
@click.stop="handleRemove(imgURL)"
>
<Close/>
</el-icon>
@@ -53,7 +53,7 @@ const state = reactive({
previewDialogVisible: false,
})
const imgUrl = computed({
const imgURL = computed<string>({
get() {
return props.modelValue
},
@@ -84,8 +84,8 @@ function handleBeforeUpload(file: any) {
function uploadImage(params: any) {
const file = params.file
uploadFile(file).then(response => {
const imgUrl = response.data
emit('update:modelValue', imgUrl)
const imgURL = response.data
emit('update:modelValue', imgURL)
})
}
@@ -93,8 +93,8 @@ function handleExceed(file: any) {
ElMessage.warning('最多只能上传' + props.maxCount)
}
function handleRemove(imgUrl: string) {
deleteFile(imgUrl)
function handleRemove(imgURL: string) {
deleteFile(imgURL)
emit('update:modelValue', '')
}
</script>

View File

@@ -64,7 +64,7 @@
</template>
</el-table-column>
<el-table-column align="center" label="单价" prop="skuPrice">
<template slot-scope="scope">{{ scope.row.skuPrice | moneyFormatter }}</template>
<template slot-scope="scope">{{ scope.row.skuPrice}}</template>
</el-table-column>
<el-table-column align="center" label="数量" prop="skuQuantity">
<template slot-scope="scope">{{ scope.row.skuQuantity }}</template>
@@ -197,8 +197,7 @@ const state = reactive({
skuPrice : undefined,
couponPrice: undefined,
freightPrice: undefined,
orderPrice : undefined,
couponPrice: undefined,
orderPrice : undefined
},
member: {},
orderItems: []
@@ -208,7 +207,7 @@ const state = reactive({
payTypeMap
})
const {loading, single, multiple, queryParams, pageList, total, dialog, orderDetail} = toRefs(state)
const {loading, single, multiple, queryParams, pageList, total, dialog,dateRange, orderDetail} = toRefs(state)
function handleQuery() {
state.loading = true

View File

@@ -155,7 +155,7 @@ const state = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined
name: undefined
},
pageList: [],
total: 0,

View File

@@ -6,7 +6,7 @@
v-loading="loading"
ref="categoryTreeRef"
:data="categoryOptions"
:props="{ label: 'name', children: 'children' }"
:props="{ label: 'name', children: 'children',disabled:'' }"
node-key="id"
:expand-on-click-node="false"
default-expand-all
@@ -145,8 +145,8 @@ const state = reactive({
title: '',
visible: false
},
parent: {},
current: {}
parent: {} as any,
current: {} as any
})
const {loading, categoryOptions, formData, rules, dialog, parent} = toRefs(state)

View File

@@ -60,11 +60,10 @@ const categoryRef = ref(ElCascaderPanel)
function handleCategoryChange() {
const checkNode = categoryRef.value.getCheckedNodes()[0]
state.pathLabels = checkNode.pathLabels // 商品分类选择层级提示
state.categoryId = checkNode.value
props.modelValue.categoryId = checkNode.value
}
function handleNext() {
console.log('商品属性',props.modelValue.categoryId)
if (!props.modelValue.categoryId) {
ElMessage.warning('请选择商品分类')
return false

View File

@@ -14,8 +14,8 @@
<el-form-item>
<el-input
v-model="queryParams.name"
placeholder="广告名称"
v-model="queryParams.title"
placeholder="广告标题"
clearable
@keyup.enter.native="handleQuery"
/>

View File

@@ -185,7 +185,7 @@ const state = reactive({
// 表格树数据
deptList: [],
// 部门树选项
deptOptions: [],
deptOptions: [] as Array<any>,
// 弹窗属性
dialog: {
title: '',

View File

@@ -168,7 +168,9 @@ const state = reactive({
name: undefined,
code: undefined,
status: undefined,
remark: undefined
remark: undefined,
sort:undefined,
value:undefined
},
rules: {
name: [
@@ -263,7 +265,9 @@ function resetForm() {
name: undefined,
code: undefined,
status: undefined,
remark: undefined
remark: undefined,
sort:undefined,
value:undefined
}
}

View File

@@ -206,7 +206,8 @@ const state = reactive({
icon: '',
sort: 1,
component: 'Layout',
path: undefined
path: undefined,
redirect:''
},
rules: {
parentId: [
@@ -356,7 +357,8 @@ function resetForm() {
icon: '',
sort: 1,
component: 'Layout',
path: undefined
path: undefined,
redirect:''
}
}

View File

@@ -8,7 +8,7 @@
:inline="true"
>
<el-form-item>
<el-button type="success" :icon="Plus" :disabled="state.disabled" @click="handleAdd">新增</el-button>
<el-button type="success" :icon="Plus" :disabled="state.single" @click="handleAdd">新增</el-button>
<el-button type="danger" :icon="Delete" :disabled="state.multiple" @click="handleDelete">删除</el-button>
</el-form-item>
<el-form-item>
@@ -137,7 +137,7 @@
<script setup lang="ts">
import {listPermsWithPage, getPermDetail, addPerm, updatePerm, deletePerms} from "@/api/system/perm"
import {Search, Plus, Edit, Refresh, Delete} from '@element-plus/icons'
import {onMounted, watch, reactive, ref, unref, getCurrentInstance} from 'vue'
import {onMounted, watch, reactive, ref, unref, getCurrentInstance, toRefs} from 'vue'
import {ElForm, ElMessage, ElMessageBox} from "element-plus"
const {proxy}: any = getCurrentInstance();
@@ -197,7 +197,7 @@ const state = reactive({
]
},
microServiceOptions: [],
requestMethodOptions: [],
requestMethodOptions: [] as Array<any>,
menuName: undefined,
urlPerm: {
requestMethod: undefined,
@@ -206,6 +206,9 @@ const state = reactive({
},
})
toRefs(state)
function handleQuery() {
if (state.queryParams.menuId) {
state.loading = true

View File

@@ -17,7 +17,7 @@
<el-tree
ref="deptTreeRef"
:data="deptOptions"
:props="{ children: 'children',label: 'label'}"
:props="{ children: 'children',label: 'label',disabled:''}"
:expand-on-click-node="false"
:filter-node-method="filterDeptNode"
default-expand-all