修复周三测试提出的住数据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;
//height: 16px;
left: -14px;
top: -3px;
top: 0px;
position: absolute;
vertical-align: 2px;
border-radius: 50%;

View File

@ -98,209 +98,211 @@
<template slot-scope="scope">
<!-- 定义插槽父组件可以使用 v-slot:prop="{row}" 搭配template标签自定义每一列单元格的样式与操作 -->
<slot :name="item.id" :row="slotrow ? scope : scope.row">
<template v-if="!lookflag">
<el-input
v-if="item.type === 'input' || item.type === 'textrea'"
:disabled="
<template v-if="scope.$index + 1 != tableInfo.tableData.length">
<template v-if="!lookflag">
<el-input
v-if="item.type === 'input' || item.type === 'textrea'"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-model="tableInfo.tableData[scope.row.index][item.id]"
placeholder=""
:maxlength="item.maxlength ? item.maxlength : ''"
></el-input>
<el-input
v-if="item.type === 'number'"
type="number"
onkeyup="value=value.replace(/[^\d]/g,'')"
:disabled="
v-model="tableInfo.tableData[scope.row.index][item.id]"
placeholder=""
:maxlength="item.maxlength ? item.maxlength : ''"
></el-input>
<el-input
v-if="item.type === 'number'"
type="number"
onkeyup="value=value.replace(/[^\d]/g,'')"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-model="tableInfo.tableData[scope.row.index][item.id]"
placeholder=""
min="1"
:maxlength="item.maxlength ? item.maxlength : ''"
></el-input>
<el-checkbox
v-if="item.type === 'checkbox'"
:disabled="
v-model="tableInfo.tableData[scope.row.index][item.id]"
placeholder=""
min="1"
:maxlength="item.maxlength ? item.maxlength : ''"
></el-input>
<el-checkbox
v-if="item.type === 'checkbox'"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox>
<BaseSelect
v-if="item.type === 'select'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox>
<BaseSelect
v-if="item.type === 'select'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
:selectInfo="item"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
></BaseSelect>
<baseCascader
:disabled="
:selectInfo="item"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
></BaseSelect>
<baseCascader
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-if="item.type === 'treeselect'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
>
</baseCascader>
<el-link
style="
v-if="item.type === 'treeselect'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
>
</baseCascader>
<el-link
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
:disabled="
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-if="item.type === 'click'"
@click="clickBoxHandle(scope.row)"
type="primary"
v-if="item.type === 'click'"
@click="clickBoxHandle(scope.row)"
type="primary"
>{{
tableInfo.tableData[scope.row.index][item.id]
? tableInfo.tableData[scope.row.index][item.id]
: "点击这里..."
}}</el-link
>
<div v-if="item.type === 'text'">
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
<div
style="
tableInfo.tableData[scope.row.index][item.id]
? tableInfo.tableData[scope.row.index][item.id]
: "点击这里..."
}}</el-link
>
<div v-if="item.type === 'text'">
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
<div
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
</el-tooltip>
</div>
<BaseDatePicker
v-if="item.type === 'datepick'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
>
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
</el-tooltip>
</div>
<BaseDatePicker
v-if="item.type === 'datepick'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
:row="scope.row"
:low="item.low ? item.low : ''"
:up="item.up ? item.up : ''"
></BaseDatePicker>
<BaseDatePicker
v-if="item.type === 'daterange'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
:row="scope.row"
:low="item.low ? item.low : ''"
:up="item.up ? item.up : ''"
></BaseDatePicker>
<BaseDatePicker
v-if="item.type === 'daterange'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
datePickerType="daterange"
></BaseDatePicker>
<BaseDatePicker
v-if="item.type === 'datetimepick'"
datePickerType="datetime"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
datePickerType="daterange"
></BaseDatePicker>
<BaseDatePicker
v-if="item.type === 'datetimepick'"
datePickerType="datetime"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
></BaseDatePicker>
<div
v-if="
></BaseDatePicker>
<div
v-if="
item.type === 'compute' &&
!lookflag &&
scope.$index + 1 != tableInfo.tableData.length
"
>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ calculator(item, scope.row) }}
</div>
<div
style="
>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ calculator(item, scope.row) }}
</div>
<div
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
{{ calculator(item, scope.row) }}
</div>
</el-tooltip>
</div>
<el-switch
v-if="item.type === 'switch'"
:disabled="
>
{{ calculator(item, scope.row) }}
</div>
</el-tooltip>
</div>
<el-switch
v-if="item.type === 'switch'"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:active-text="row.activeText"
:inactive-text="row.inactiveText"
:active-value="row.activeValue ? row.activeValue : true"
:inactive-value="
v-model="tableInfo.tableData[scope.row.index][item.id]"
:active-text="row.activeText"
:inactive-text="row.inactiveText"
:active-value="row.activeValue ? row.activeValue : true"
:inactive-value="
row.inactiveValue || row.inactiveValue == 0
? row.inactiveValue
: false
"
>
</el-switch>
</template>
<template v-else>
<div
v-if="
>
</el-switch>
</template>
<template v-else>
<div
v-if="
item.type != 'checkbok' &&
item.type !== 'select' &&
item.type !== 'treeselect' &&
item.type !== 'datepick'
"
>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
<div
style="
>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
<div
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
</el-tooltip>
</div>
<BaseSelect
v-if="item.type === 'select'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
>
{{ tableInfo.tableData[scope.row.index][item.id] }}
</div>
</el-tooltip>
</div>
<BaseSelect
v-if="item.type === 'select'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
:selectInfo="item"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
:lookflag="true"
></BaseSelect>
<baseCascader
v-if="item.type === 'treeselect'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:lookflag="true"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
>
</baseCascader>
<div v-if="item.type === 'datepick'">
{{
tableInfo.tableData[scope.row.index][item.id].split("T")[0]
}}
</div>
<el-checkbox
v-if="item.type === 'checkbox'"
:disabled="
:selectInfo="item"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
:lookflag="true"
></BaseSelect>
<baseCascader
v-if="item.type === 'treeselect'"
v-model="tableInfo.tableData[scope.row.index][item.id]"
:lookflag="true"
:itemObj="item"
:ruleForm="tableInfo.tableData[scope.row.index]"
>
</baseCascader>
<div v-if="item.type === 'datepick'">
{{
tableInfo.tableData[scope.row.index][item.id].split("T")[0]
}}
</div>
<el-checkbox
v-if="item.type === 'checkbox'"
:disabled="
lookflag || scope.$index + 1 == tableInfo.tableData.length
"
v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox>
v-model="tableInfo.tableData[scope.row.index][item.id]"
></el-checkbox>
</template>
</template>
</slot>
</template>

View File

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

View File

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

View File

@ -249,7 +249,9 @@ export default {
},
// (
mainDeleOnFunc(row, item) {
this.$confirm('确定删除?')
console.log(row, 'row')
let msg = row.dbType == 1 ? '删除主表将会导致所有相关子表一并删除,是否确认继续删除操作?' : '确定是否删除?'
this.$confirm(msg)
.then(async(_) => {
this.openLoading('submit')
const res = await authApi('mdmModuleService', '', 'deleteMdmDb', '', {
@ -257,6 +259,10 @@ export default {
...row
})
this.$vmNews('删除成功!', 'success')
if (this.mainTempClick.id === row.id || row.dbType == 1) {
this.activedTableData = []
this.mainTempClick = {}
}
this.getMainTableHandle()
})
.catch((_) => {
@ -407,7 +413,7 @@ export default {
this.$refs.mainTable.$refs.mainOptionForm.$refs['ruleForm'].validate(async(valid) => {
if (valid) {
//
let blacklist = ['id', 'document_rule', 'document_rule_num', 'data_status', 'add_status', 'update_status', 'delete_status', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id', 'company_id','data_id']
let blacklist = ['id', 'document_rule', 'document_rule_num', 'data_status', 'add_status', 'update_status', 'delete_status', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id', 'company_id', 'data_id']
let form = this.$refs.mainTable.mainOptionForm
//
if (blacklist.includes(form.dbName)) {
@ -529,6 +535,7 @@ export default {
margin-left: 5px;
border-radius: 8px;
height: calc(100%);
.mainAddRow {
margin-top: 30px;
border: 1px dotted #ccc;

View File

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

View File

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

View File

@ -43,10 +43,10 @@
<div class="upload">
<div class="uploadMain">
<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/"
:on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload"
list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess"
:on-preview="handlePreview" :before-upload="handleProgress"
list-type="picture" :limit="1" :disabled="lookFlag"
:show-file-list="false"
>
<div class="line">
@ -121,10 +121,27 @@ export default {
},
methods: {
//
handleProgress(file, fileList) {
this.loading = true
handleProgress(fileList, file) {
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.loading = false
})
},
handlePreview(file) {
@ -132,9 +149,9 @@ export default {
async handleAvatarSuccess(res, file) {
this.loading = true
this.$refs.upload.clearFiles()//
this.imgUrl = URL.createObjectURL(file.raw)
this.imgUrl = URL.createObjectURL(file)
let formData = new FormData()
formData.append('file', file.raw)
formData.append('file', file)
formData.append('fileFlag', true)
formData.append('businessType', 'application')
return request({
@ -142,35 +159,18 @@ export default {
method: 'post',
data: formData
}).then((res) => {
if (res.status === '200') {
console.log(res)
this.$vmNews('上传成功', 'success')
this.appLogo = res.attribute.id
this.loading = false
}
})
this.loading = false
return true
},
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() {
@ -307,7 +307,7 @@ export default {
margin-left: 5px;
.title {
margin-bottom: 32px;
margin-bottom: 20px;
margin-left: 32px;
font-family: PingFangSC, PingFang SC;
font-weight: 600;
@ -399,7 +399,7 @@ export default {
justify-content: space-between;
> .left {
> .title {
> .smalltitle {
font-size: 18px;
color: #999999;
margin-bottom: 10px;
@ -443,10 +443,12 @@ export default {
margin-top: 10px;
background-color: #fff;
border-radius: 16px;
.line{
.line {
margin-left: 32px;
display: flex;
.name{
.name {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 18px;
@ -455,7 +457,8 @@ export default {
text-align: left;
font-style: normal;
}
.value{
.value {
display: flex;
margin-left: 15px;
font-family: PingFangSC, PingFang SC;