修复周三测试提出的住数据bug

This commit is contained in:
hyt 2024-06-26 16:42:43 +08:00
parent 59a6cc4946
commit a1d3e34009
8 changed files with 202 additions and 190 deletions

View File

@ -370,7 +370,7 @@ export default {
//width: 16px; //width: 16px;
//height: 16px; //height: 16px;
left: -14px; left: -14px;
top: -3px; top: 0px;
position: absolute; position: absolute;
vertical-align: 2px; vertical-align: 2px;
border-radius: 50%; border-radius: 50%;

View File

@ -98,6 +98,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 定义插槽父组件可以使用 v-slot:prop="{row}" 搭配template标签自定义每一列单元格的样式与操作 --> <!-- 定义插槽父组件可以使用 v-slot:prop="{row}" 搭配template标签自定义每一列单元格的样式与操作 -->
<slot :name="item.id" :row="slotrow ? scope : scope.row"> <slot :name="item.id" :row="slotrow ? scope : scope.row">
<template v-if="scope.$index + 1 != tableInfo.tableData.length">
<template v-if="!lookflag"> <template v-if="!lookflag">
<el-input <el-input
v-if="item.type === 'input' || item.type === 'textrea'" v-if="item.type === 'input' || item.type === 'textrea'"
@ -302,6 +303,7 @@
v-model="tableInfo.tableData[scope.row.index][item.id]" v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox> ></el-checkbox>
</template> </template>
</template>
</slot> </slot>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -278,7 +278,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.receiptsAddRow { .receiptsAddRow {
margin-top: 30px; margin-top: 15px;
border: 1px dotted #ccc; border: 1px dotted #ccc;
text-align: center; text-align: center;
height: 50px; height: 50px;

View File

@ -47,8 +47,8 @@ const optionFormRow = [
disabled: false, disabled: false,
required: true, required: true,
fontSize: 16, fontSize: 16,
pattern: /^[a-zA-Z][a-zA-Z0-9_]{0,50}$/, pattern: /^[a-z][a-z0-9_]{0,50}$/,
message: "须以字母开头且不能出现_外的字符与中文", message: "须以字母开头且字母小写且不能出现_外的字符与中文",
disabledOfId: true, disabledOfId: true,
}, },
], ],

View File

@ -249,7 +249,9 @@ export default {
}, },
// ( // (
mainDeleOnFunc(row, item) { mainDeleOnFunc(row, item) {
this.$confirm('确定删除?') console.log(row, 'row')
let msg = row.dbType == 1 ? '删除主表将会导致所有相关子表一并删除,是否确认继续删除操作?' : '确定是否删除?'
this.$confirm(msg)
.then(async(_) => { .then(async(_) => {
this.openLoading('submit') this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDb', '', { const res = await authApi('mdmModuleService', '', 'deleteMdmDb', '', {
@ -257,6 +259,10 @@ export default {
...row ...row
}) })
this.$vmNews('删除成功!', 'success') this.$vmNews('删除成功!', 'success')
if (this.mainTempClick.id === row.id || row.dbType == 1) {
this.activedTableData = []
this.mainTempClick = {}
}
this.getMainTableHandle() this.getMainTableHandle()
}) })
.catch((_) => { .catch((_) => {
@ -529,6 +535,7 @@ export default {
margin-left: 5px; margin-left: 5px;
border-radius: 8px; border-radius: 8px;
height: calc(100%); height: calc(100%);
.mainAddRow { .mainAddRow {
margin-top: 30px; margin-top: 30px;
border: 1px dotted #ccc; border: 1px dotted #ccc;

View File

@ -99,8 +99,8 @@ export default {
disabled: false, disabled: false,
required: true, required: true,
fontSize: 16, fontSize: 16,
pattern: /^[a-zA-Z][a-zA-Z0-9_]{0,50}$/, pattern: /^[a-z][a-z0-9_]{0,50}$/,
message: '须以字母开头且不能出现_外的字符与中文', message: "须以需字母开头且字母小写且不能出现_外的字符与中文",
disabledOfId: true disabledOfId: true
} }
] ]

View File

@ -277,7 +277,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.receiptsAddRow { .receiptsAddRow {
margin-top: 30px; margin-top: 15px;
border: 1px dotted #ccc; border: 1px dotted #ccc;
text-align: center; text-align: center;
height: 50px; height: 50px;

View File

@ -43,10 +43,10 @@
<div class="upload"> <div class="upload">
<div class="uploadMain"> <div class="uploadMain">
<div class="left"> <div class="left">
<div class="title">主数据logo</div> <div class="smalltitle">主数据logo</div>
<el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/" <el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload" :on-preview="handlePreview" :before-upload="handleProgress"
list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess" list-type="picture" :limit="1" :disabled="lookFlag"
:show-file-list="false" :show-file-list="false"
> >
<div class="line"> <div class="line">
@ -121,10 +121,27 @@ export default {
}, },
methods: { methods: {
// //
handleProgress(file, fileList) { handleProgress(fileList, file) {
this.loading = true console.log(fileList, 'file')
if (!fileList) return
if (
fileList.type.split('/')[1] != 'jpeg' &&
fileList.type.split('/')[1] != 'png'
) {
this.$message({
type: 'warning',
message: '只能上传jpg/png文件'
})
return false
}
if (fileList.size >= 2000000) {
this.$message({
type: 'warning',
message: '文件大小不超过2MB'
})
return false
}
this.handleAvatarSuccess({}, fileList).then(res => { this.handleAvatarSuccess({}, fileList).then(res => {
this.loading = false
}) })
}, },
handlePreview(file) { handlePreview(file) {
@ -132,9 +149,9 @@ export default {
async handleAvatarSuccess(res, file) { async handleAvatarSuccess(res, file) {
this.loading = true this.loading = true
this.$refs.upload.clearFiles()// this.$refs.upload.clearFiles()//
this.imgUrl = URL.createObjectURL(file.raw) this.imgUrl = URL.createObjectURL(file)
let formData = new FormData() let formData = new FormData()
formData.append('file', file.raw) formData.append('file', file)
formData.append('fileFlag', true) formData.append('fileFlag', true)
formData.append('businessType', 'application') formData.append('businessType', 'application')
return request({ return request({
@ -142,35 +159,18 @@ export default {
method: 'post', method: 'post',
data: formData data: formData
}).then((res) => { }).then((res) => {
if (res.status === '200') { if (res.status === '200') {
console.log(res) console.log(res)
this.$vmNews('上传成功', 'success') this.$vmNews('上传成功', 'success')
this.appLogo = res.attribute.id this.appLogo = res.attribute.id
this.loading = false
} }
}) })
this.loading = false
return true return true
}, },
async beforeUpload(file) { async beforeUpload(file) {
if (
file.type.split('/')[1] != 'jpeg' &&
file.type.split('/')[1] != 'png'
) {
this.$message({
type: 'warning',
message: '只能上传jpg/png文件'
})
return
} else {
if (file.size >= 2000000) {
this.$message({
type: 'warning',
message: '文件大小不超过2MB'
})
return
}
}
}, },
// //
saveHandle() { saveHandle() {
@ -307,7 +307,7 @@ export default {
margin-left: 5px; margin-left: 5px;
.title { .title {
margin-bottom: 32px; margin-bottom: 20px;
margin-left: 32px; margin-left: 32px;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 600; font-weight: 600;
@ -399,7 +399,7 @@ export default {
justify-content: space-between; justify-content: space-between;
> .left { > .left {
> .title { > .smalltitle {
font-size: 18px; font-size: 18px;
color: #999999; color: #999999;
margin-bottom: 10px; margin-bottom: 10px;
@ -443,9 +443,11 @@ export default {
margin-top: 10px; margin-top: 10px;
background-color: #fff; background-color: #fff;
border-radius: 16px; border-radius: 16px;
.line { .line {
margin-left: 32px; margin-left: 32px;
display: flex; display: flex;
.name { .name {
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 400;
@ -455,6 +457,7 @@ export default {
text-align: left; text-align: left;
font-style: normal; font-style: normal;
} }
.value { .value {
display: flex; display: flex;
margin-left: 15px; margin-left: 15px;