切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
5 years ago
提交
2fecaeae0ba564f990da9f41dcc0bf686e3c4bcd
1 个父辈
b44add7a
新增开关切换确认提示功能
优化拖拽排序
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
85 行增加
和
28 行删除
application/admin/controller/Ajax.php
application/admin/view/general/config/index.html
public/assets/js/require-backend.min.js
public/assets/js/require-form.js
public/assets/js/require-table.js
application/admin/controller/Ajax.php
查看文件 @
2fecaea
...
...
@@ -173,6 +173,9 @@ class Ajax extends Backend
$offset
=
isset
(
$temp
[
$m
-
1
])
?
$temp
[
$m
-
1
]
:
$sour_id
;
}
}
if
(
!
isset
(
$weighdata
[
$offset
]))
{
continue
;
}
$weighids
[
$n
]
=
$weighdata
[
$offset
];
Db
::
name
(
$table
)
->
where
(
$prikey
,
$n
)
->
update
([
$field
=>
$weighdata
[
$offset
]]);
}
...
...
application/admin/view/general/config/index.html
查看文件 @
2fecaea
...
...
@@ -93,14 +93,18 @@
<input
{$
item
.
extend_html
}
type=
"number"
name=
"row[{$item.name}]"
value=
"{$item.value|htmlentities}"
class=
"form-control"
data-tip=
"{$item.tip}"
data-rule=
"{$item.rule}"
/>
{/case}
{case checkbox}
<div
class=
"checkbox"
>
{foreach name="item.content" item="vo"}
<label
for=
"row[{$item.name}][]-{$key}"
><input
id=
"row[{$item.name}][]-{$key}"
name=
"row[{$item.name}][]"
type=
"checkbox"
value=
"{$key}"
data-tip=
"{$item.tip}"
{
in
name=
"key"
value=
"$item.value"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
{/case}
{case radio}
<div
class=
"radio"
>
{foreach name="item.content" item="vo"}
<label
for=
"row[{$item.name}]-{$key}"
><input
id=
"row[{$item.name}]-{$key}"
name=
"row[{$item.name}]"
type=
"radio"
value=
"{$key}"
data-tip=
"{$item.tip}"
{
in
name=
"key"
value=
"$item.value"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
{/case}
{case value="select" break="0"}{/case}
{case value="selects"}
...
...
public/assets/js/require-backend.min.js
查看文件 @
2fecaea
...
...
@@ -10378,20 +10378,31 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
if
(
$
(
this
).
hasClass
(
"disabled"
))
{
return
false
;
}
var
input
=
$
(
this
).
prev
(
"input"
);
input
=
$
(
this
).
data
(
"input-id"
)
?
$
(
"#"
+
$
(
this
).
data
(
"input-id"
))
:
input
;
if
(
input
.
size
()
>
0
)
{
var
yes
=
$
(
this
).
data
(
"yes"
);
var
no
=
$
(
this
).
data
(
"no"
);
if
(
input
.
val
()
==
yes
)
{
input
.
val
(
no
);
$
(
"i"
,
this
).
addClass
(
"fa-flip-horizontal text-gray"
);
}
else
{
input
.
val
(
yes
);
$
(
"i"
,
this
).
removeClass
(
"fa-flip-horizontal text-gray"
);
var
switcher
=
$
.
proxy
(
function
()
{
var
input
=
$
(
this
).
prev
(
"input"
);
input
=
$
(
this
).
data
(
"input-id"
)
?
$
(
"#"
+
$
(
this
).
data
(
"input-id"
))
:
input
;
if
(
input
.
size
()
>
0
)
{
var
yes
=
$
(
this
).
data
(
"yes"
);
var
no
=
$
(
this
).
data
(
"no"
);
if
(
input
.
val
()
==
yes
)
{
input
.
val
(
no
);
$
(
"i"
,
this
).
addClass
(
"fa-flip-horizontal text-gray"
);
}
else
{
input
.
val
(
yes
);
$
(
"i"
,
this
).
removeClass
(
"fa-flip-horizontal text-gray"
);
}
input
.
trigger
(
'change'
);
}
input
.
trigger
(
'change'
);
},
this
);
if
(
typeof
$
(
this
).
data
(
"confirm"
)
!==
'undefined'
)
{
Layer
.
confirm
(
$
(
this
).
data
(
"confirm"
),
function
(
index
)
{
switcher
();
Layer
.
close
(
index
);
});
}
else
{
switcher
();
}
return
false
;
});
},
...
...
@@ -11951,7 +11962,17 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
});
table
.
on
(
"click"
,
"[data-id].btn-change"
,
function
(
e
)
{
e
.
preventDefault
();
Table
.
api
.
multi
(
$
(
this
).
data
(
"action"
)
?
$
(
this
).
data
(
"action"
)
:
''
,
[
$
(
this
).
data
(
"id"
)],
table
,
this
);
var
switcher
=
$
.
proxy
(
function
()
{
Table
.
api
.
multi
(
$
(
this
).
data
(
"action"
)
?
$
(
this
).
data
(
"action"
)
:
''
,
[
$
(
this
).
data
(
"id"
)],
table
,
this
);
},
this
);
if
(
typeof
$
(
this
).
data
(
"confirm"
)
!==
'undefined'
)
{
Layer
.
confirm
(
$
(
this
).
data
(
"confirm"
),
function
(
index
)
{
switcher
();
Layer
.
close
(
index
);
});
}
else
{
switcher
();
}
});
table
.
on
(
"click"
,
"[data-id].btn-edit"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -12131,12 +12152,16 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
var
url
=
typeof
this
.
url
!==
'undefined'
?
this
.
url
:
''
;
var
confirm
=
''
;
var
disable
=
false
;
if
(
typeof
this
.
confirm
!==
"undefined"
)
{
confirm
=
typeof
this
.
confirm
===
"function"
?
this
.
confirm
.
call
(
this
,
value
,
row
,
index
)
:
this
.
confirm
;
}
if
(
typeof
this
.
disable
!==
"undefined"
)
{
disable
=
typeof
this
.
disable
===
"function"
?
this
.
disable
.
call
(
this
,
value
,
row
,
index
)
:
this
.
disable
;
}
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change "
+
(
disable
?
'btn disabled'
:
''
)
+
"' data-id='"
+
row
[
pk
]
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
+
row
[
pk
]
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
(
confirm
?
"data-confirm='"
+
confirm
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
value
=
value
===
null
?
''
:
value
.
toString
();
...
...
public/assets/js/require-form.js
查看文件 @
2fecaea
...
...
@@ -382,20 +382,31 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
if
(
$
(
this
).
hasClass
(
"disabled"
))
{
return
false
;
}
var
input
=
$
(
this
).
prev
(
"input"
);
input
=
$
(
this
).
data
(
"input-id"
)
?
$
(
"#"
+
$
(
this
).
data
(
"input-id"
))
:
input
;
if
(
input
.
size
()
>
0
)
{
var
yes
=
$
(
this
).
data
(
"yes"
);
var
no
=
$
(
this
).
data
(
"no"
);
if
(
input
.
val
()
==
yes
)
{
input
.
val
(
no
);
$
(
"i"
,
this
).
addClass
(
"fa-flip-horizontal text-gray"
);
}
else
{
input
.
val
(
yes
);
$
(
"i"
,
this
).
removeClass
(
"fa-flip-horizontal text-gray"
);
var
switcher
=
$
.
proxy
(
function
()
{
var
input
=
$
(
this
).
prev
(
"input"
);
input
=
$
(
this
).
data
(
"input-id"
)
?
$
(
"#"
+
$
(
this
).
data
(
"input-id"
))
:
input
;
if
(
input
.
size
()
>
0
)
{
var
yes
=
$
(
this
).
data
(
"yes"
);
var
no
=
$
(
this
).
data
(
"no"
);
if
(
input
.
val
()
==
yes
)
{
input
.
val
(
no
);
$
(
"i"
,
this
).
addClass
(
"fa-flip-horizontal text-gray"
);
}
else
{
input
.
val
(
yes
);
$
(
"i"
,
this
).
removeClass
(
"fa-flip-horizontal text-gray"
);
}
input
.
trigger
(
'change'
);
}
input
.
trigger
(
'change'
);
},
this
);
if
(
typeof
$
(
this
).
data
(
"confirm"
)
!==
'undefined'
)
{
Layer
.
confirm
(
$
(
this
).
data
(
"confirm"
),
function
(
index
)
{
switcher
();
Layer
.
close
(
index
);
});
}
else
{
switcher
();
}
return
false
;
});
},
...
...
public/assets/js/require-table.js
查看文件 @
2fecaea
...
...
@@ -435,7 +435,17 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
});
table
.
on
(
"click"
,
"[data-id].btn-change"
,
function
(
e
)
{
e
.
preventDefault
();
Table
.
api
.
multi
(
$
(
this
).
data
(
"action"
)
?
$
(
this
).
data
(
"action"
)
:
''
,
[
$
(
this
).
data
(
"id"
)],
table
,
this
);
var
switcher
=
$
.
proxy
(
function
()
{
Table
.
api
.
multi
(
$
(
this
).
data
(
"action"
)
?
$
(
this
).
data
(
"action"
)
:
''
,
[
$
(
this
).
data
(
"id"
)],
table
,
this
);
},
this
);
if
(
typeof
$
(
this
).
data
(
"confirm"
)
!==
'undefined'
)
{
Layer
.
confirm
(
$
(
this
).
data
(
"confirm"
),
function
(
index
)
{
switcher
();
Layer
.
close
(
index
);
});
}
else
{
switcher
();
}
});
table
.
on
(
"click"
,
"[data-id].btn-edit"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -615,12 +625,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
var
url
=
typeof
this
.
url
!==
'undefined'
?
this
.
url
:
''
;
var
confirm
=
''
;
var
disable
=
false
;
if
(
typeof
this
.
confirm
!==
"undefined"
)
{
confirm
=
typeof
this
.
confirm
===
"function"
?
this
.
confirm
.
call
(
this
,
value
,
row
,
index
)
:
this
.
confirm
;
}
if
(
typeof
this
.
disable
!==
"undefined"
)
{
disable
=
typeof
this
.
disable
===
"function"
?
this
.
disable
.
call
(
this
,
value
,
row
,
index
)
:
this
.
disable
;
}
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change "
+
(
disable
?
'btn disabled'
:
''
)
+
"' data-id='"
+
row
[
pk
]
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
+
row
[
pk
]
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
(
confirm
?
"data-confirm='"
+
confirm
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
value
=
value
===
null
?
''
:
value
.
toString
();
...
...
请
注册
或
登录
后发表评论