|
@@ -418,7 +418,7 @@ function addDelInputB(t,type) {
|
|
/* 添加排除/附加词 */
|
|
/* 添加排除/附加词 */
|
|
var excludeArr = []
|
|
var excludeArr = []
|
|
var appendArr = []
|
|
var appendArr = []
|
|
-function addOtherInput(t,f) {
|
|
|
|
|
|
+function addOtherInput(t,f, type) {
|
|
if($("#keyInput").val()==""){
|
|
if($("#keyInput").val()==""){
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -441,26 +441,33 @@ function addOtherInput(t,f) {
|
|
input.placeholder = temp
|
|
input.placeholder = temp
|
|
input.maxLength = 20;
|
|
input.maxLength = 20;
|
|
if(f){
|
|
if(f){
|
|
- var l = appendArr.length
|
|
|
|
- $(input).on('input',function () {
|
|
|
|
|
|
+ if(type !== 'edit') {
|
|
|
|
+ var l = appendArr.length
|
|
|
|
+ console.log($(input), 'input input');
|
|
|
|
+ console.log(appendArr, l, 'append--add');
|
|
|
|
+ $(input).on('input',function () {
|
|
var val = $.trim($(this).val()).replace(/\s/g,"");
|
|
var val = $.trim($(this).val()).replace(/\s/g,"");
|
|
|
|
+ console.log(val, 'val');
|
|
if(val){
|
|
if(val){
|
|
appendArr[l] = val
|
|
appendArr[l] = val
|
|
}else {
|
|
}else {
|
|
- // appendArr.splice(l,1)
|
|
|
|
|
|
+ appendArr.splice(l,1)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- // console.log(appendArr, 'appendArr');
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}else {
|
|
}else {
|
|
- var l = excludeArr.length
|
|
|
|
- $(input).on('input',function () {
|
|
|
|
- var val = $.trim($(this).val()).replace(/\s/g,"");
|
|
|
|
- if(val){
|
|
|
|
- excludeArr[l] = val
|
|
|
|
- }else{
|
|
|
|
- // excludeArr.splice(l,1)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if (type !== 'edit') {
|
|
|
|
+ var l = excludeArr.length
|
|
|
|
+ $(input).on('input',function () {
|
|
|
|
+ var val = $.trim($(this).val()).replace(/\s/g,"");
|
|
|
|
+ if(val){
|
|
|
|
+ excludeArr[l] = val
|
|
|
|
+ }else{
|
|
|
|
+ excludeArr.splice(l,1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// console.log('附加词:' + appendArr, '排除词:'+ excludeArr);
|
|
// console.log('附加词:' + appendArr, '排除词:'+ excludeArr);
|
|
$(t).before(input)
|
|
$(t).before(input)
|
|
@@ -565,8 +572,10 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
|
|
if(append){
|
|
if(append){
|
|
$('.new-box .add-input-w').show()
|
|
$('.new-box .add-input-w').show()
|
|
append = append.split(",")
|
|
append = append.split(",")
|
|
|
|
+ // console.log(append, 'append-1');
|
|
append.forEach(function (value, index) {
|
|
append.forEach(function (value, index) {
|
|
- addOtherInput('.new-box .l .add-w', true)
|
|
|
|
|
|
+ addOtherInput('.new-box .l .add-w', true, 'edit')
|
|
|
|
+
|
|
$('.new-box .l .sm:eq(' + index + ')').val(value)
|
|
$('.new-box .l .sm:eq(' + index + ')').val(value)
|
|
$('.new-box .l .sm:eq(' + index + ')').on('input', function() {
|
|
$('.new-box .l .sm:eq(' + index + ')').on('input', function() {
|
|
if ($(this).val()) {
|
|
if ($(this).val()) {
|
|
@@ -577,12 +586,13 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
appendArr = append
|
|
appendArr = append
|
|
|
|
+ console.log(appendArr, 'append-edit');
|
|
}
|
|
}
|
|
if(exclude){
|
|
if(exclude){
|
|
$('.new-box.r.add-w').show()
|
|
$('.new-box.r.add-w').show()
|
|
exclude = exclude.split(",")
|
|
exclude = exclude.split(",")
|
|
exclude.forEach(function (value, index) {
|
|
exclude.forEach(function (value, index) {
|
|
- addOtherInput('.new-box .r .add-w', false)
|
|
|
|
|
|
+ addOtherInput('.new-box .r .add-w', false, 'edit')
|
|
$('.new-box .r .sm:eq(' + index + ')').val(value)
|
|
$('.new-box .r .sm:eq(' + index + ')').val(value)
|
|
$('.new-box .r .sm:eq(' + index + ')').on('input', function() {
|
|
$('.new-box .r .sm:eq(' + index + ')').on('input', function() {
|
|
if ($(this).val()) {
|
|
if ($(this).val()) {
|