{{ item.name }}
@@ -71,54 +80,55 @@ export default {
data() {
return {
localHitchVisible: false,
+ hitchRemarkArray: [],
form: {
- hitchType: null,
+ checkRepeatType: null,
hitchFiled: null,
- matchedPattern: '1',
+ matchingMode: 1,
hitchRemark: null,
file: null
},
fileList: [],
typeOptions: [
{
- value: '1',
+ value: 1,
label: '跳过'
},
{
- value: '2',
+ value: 2,
label: '覆盖'
},
{
- value: '3',
+ value: 3,
label: '追加'
}
],
matchedOptions: [
{
- value: '1',
+ value: 1,
label: '全量匹配'
},
{
- value: '2',
+ value: 2,
label: '前缀模糊匹配'
},
{
- value: '3',
+ value: 3,
label: '后缀模糊匹配'
}
],
fieldOptions: [],
rules: {
- hitchType: [
+ checkRepeatType: [
{ required: true, message: '请选择', trigger: 'change' }
],
hitchFiled: [
{ required: true, message: '请选择', trigger: 'change' }
],
hitchRemark: [
- { required: true, message: '请输入', trigger: 'blur' }
+ { required: true, message: '请选择上面挂接字段生成挂接详情', trigger: 'blur' }
],
- matchedPattern: [
+ matchingMode: [
{ required: true, message: '请选择', trigger: 'change' }
],
file: [
@@ -150,27 +160,27 @@ export default {
},
handleFile(event) {
const files = event.target.files
- // const file = files[0] // 获取上传的文件
- // const allowedExtensions = /(\.xlsx)$/i // 定义允许上传的文件格式,这里只限制为xlsx格式
- // if (!allowedExtensions.exec(file.name)) {
- // this.$message.warning('只能上传Excel文件!') // 弹出提示信息
- // event.target.value = '' // 清空文件输入框内容
- // return false
- // }
+ console.log(files)
for (let i = 0; i < files.length; i++) {
this.fileList = []
- this.form.file = null
this.fileList.push(files[i])
- this.form.file = files[i]
+ // this.form.file = files[i]
}
},
- handleCancel() {
- this.$refs['form'].resetFields()
- this.fileList = []
- this.form.file = null
- this.localHitchVisible = false
- },
handleComfired() {
+ if (this.hitchRemarkArray.length !== 0) {
+ if (this.hitchRemarkArray.length === 1) {
+ const index = this.hitchRemarkArray.indexOf('*')
+ if (index !== -1) {
+ this.form.hitchRemark = ''
+ }
+ } else {
+ this.form.hitchRemark = this.hitchRemarkArray.join('')
+ }
+ } else {
+ this.form.hitchRemark = ''
+ }
+ console.log(this.form)
this.$refs['form'].validate((valid) => {
if (valid) {
this.localHitchVisible = false
@@ -195,18 +205,53 @@ export default {
})
},
selectFiled(val) {
- console.log('val', val)
if (val) {
- if (this.form.hitchRemark && this.form.hitchRemark.includes(val)) {
+ if (this.hitchRemarkArray && this.hitchRemarkArray.includes('$' + val + '$')) {
this.$message.warning('请注意当前选择的挂接字段,在挂接详情内已存在!')
} else {
- if (!this.form.hitchRemark) {
- this.form.hitchRemark = '$' + val + '$'
+ const lastItemIndex = this.hitchRemarkArray.length - 1
+ const index = this.hitchRemarkArray.indexOf('*')
+ if (index !== -1) {
+ if (index === lastItemIndex) {
+ if (this.form.matchingMode === 2) {
+ this.hitchRemarkArray.unshift('$' + val + '$')
+ } else if (this.form.matchingMode === 3) {
+ this.hitchRemarkArray.push('$' + val + '$')
+ } else {
+ this.hitchRemarkArray.splice(index > 0 ? index : 0, 0, '$' + val + '$')
+ }
+ } else {
+ this.hitchRemarkArray.push('$' + val + '$')
+ }
} else {
- this.form.hitchRemark += ' $' + val + '$'
+ this.hitchRemarkArray.push('$' + val + '$')
}
}
}
+ },
+ changeMatchedType(val) {
+ const symbol = '*'
+ const index = this.hitchRemarkArray.indexOf(symbol)
+ if (index !== -1) {
+ this.hitchRemarkArray.splice(index, 1)
+ }
+ if (val === 2) {
+ this.hitchRemarkArray.push(symbol)
+ } else if (val === 3) {
+ this.hitchRemarkArray.unshift(symbol)
+ }
+ },
+ removeTag(tag) {
+ const index = this.hitchRemarkArray.indexOf(tag)
+ if (index !== -1) {
+ this.hitchRemarkArray.splice(index, 1)
+ }
+ },
+ handleCancel() {
+ this.$refs.form.resetFields()
+ this.hitchRemarkArray = []
+ this.form.file = null
+ this.localHitchVisible = false
}
}
}
@@ -228,4 +273,17 @@ export default {
font-size: 12px;
color: #A6ADB6;
}
+.tag-wrapper{
+ display: flex;
+ justify-content: flex-start;
+ flex-wrap: wrap;
+ width: 400px;
+ min-height: 32px;
+ padding: 0 10px;
+ border-radius: 3px;
+ border: 1px solid #e6e8ed;
+ .el-tag{
+ margin-right: 6px;
+ }
+}
diff --git a/src/views/collectReorganizi/collectionLibrary/anjuan/content.vue b/src/views/collectReorganizi/collectionLibrary/anjuan/content.vue
index 429b283..cf20c72 100644
--- a/src/views/collectReorganizi/collectionLibrary/anjuan/content.vue
+++ b/src/views/collectReorganizi/collectionLibrary/anjuan/content.vue
@@ -6,7 +6,7 @@
-
+