Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
8c065bd1
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1172
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8c065bd1
编写于
1月 05, 2019
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
矩阵单选题行、列删除完成,删除冗余代码
上级
7ed6079e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
1157 addition
and
365 deletion
+1157
-365
logs/skyeye.log
logs/skyeye.log
+961
-0
skyeye-promote/src/main/java/com/skyeye/eve/controller/DwSurveyDirectoryController.java
...om/skyeye/eve/controller/DwSurveyDirectoryController.java
+32
-0
skyeye-promote/src/main/java/com/skyeye/eve/dao/DwSurveyDirectoryDao.java
...rc/main/java/com/skyeye/eve/dao/DwSurveyDirectoryDao.java
+12
-0
skyeye-promote/src/main/java/com/skyeye/eve/service/DwSurveyDirectoryService.java
...java/com/skyeye/eve/service/DwSurveyDirectoryService.java
+4
-0
skyeye-promote/src/main/java/com/skyeye/eve/service/impl/DwSurveyDirectoryServiceImpl.java
...skyeye/eve/service/impl/DwSurveyDirectoryServiceImpl.java
+48
-0
skyeye-promote/src/main/resources/dbmapper/DwSurveyDirectoryMapper.xml
...e/src/main/resources/dbmapper/DwSurveyDirectoryMapper.xml
+65
-0
skyeye-promote/src/main/resources/mapping/reqdwsurvey.xml
skyeye-promote/src/main/resources/mapping/reqdwsurvey.xml
+6
-0
skyeye-promote/src/main/resources/template/js/dwsurveydesign/dwsurveydesign.js
...in/resources/template/js/dwsurveydesign/dwsurveydesign.js
+29
-365
未找到文件。
logs/skyeye.log
浏览文件 @
8c065bd1
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
skyeye-promote/src/main/java/com/skyeye/eve/controller/DwSurveyDirectoryController.java
浏览文件 @
8c065bd1
...
...
@@ -256,4 +256,36 @@ public class DwSurveyDirectoryController {
dwSurveyDirectoryService
.
deleteQuestionMationById
(
inputObject
,
outputObject
);
}
/**
*
* @Title: deleteQuestionChenColumnMationById
* @Description: 删除矩阵单选题列选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/DwSurveyDirectoryController/deleteQuestionChenColumnMationById"
)
@ResponseBody
public
void
deleteQuestionChenColumnMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
dwSurveyDirectoryService
.
deleteQuestionChenColumnMationById
(
inputObject
,
outputObject
);
}
/**
*
* @Title: deleteQuestionChenRowMationById
* @Description: 删除矩阵单选题行选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/DwSurveyDirectoryController/deleteQuestionChenRowMationById"
)
@ResponseBody
public
void
deleteQuestionChenRowMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
dwSurveyDirectoryService
.
deleteQuestionChenRowMationById
(
inputObject
,
outputObject
);
}
}
skyeye-promote/src/main/java/com/skyeye/eve/dao/DwSurveyDirectoryDao.java
浏览文件 @
8c065bd1
...
...
@@ -70,4 +70,16 @@ public interface DwSurveyDirectoryDao {
public
int
updateQuestionOrderByIdByQuId
(
Map
<
String
,
Object
>
question
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryQuestionChenColumnById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
deleteLogicQuestionChenColumnMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
deleteQuestionChenColumnMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryQuestionChenRowById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
deleteQuestionChenRowMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
deleteLogicQuestionChenRowMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
}
skyeye-promote/src/main/java/com/skyeye/eve/service/DwSurveyDirectoryService.java
浏览文件 @
8c065bd1
...
...
@@ -35,4 +35,8 @@ public interface DwSurveyDirectoryService {
public
void
deleteQuestionMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
deleteQuestionChenColumnMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
deleteQuestionChenRowMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
}
skyeye-promote/src/main/java/com/skyeye/eve/service/impl/DwSurveyDirectoryServiceImpl.java
浏览文件 @
8c065bd1
...
...
@@ -824,5 +824,53 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
dwSurveyDirectoryDao
.
updateQuestionOrderByIdByQuId
(
question
);
//修改该问题排序后面的序号减1
}
}
/**
*
* @Title: deleteQuestionChenColumnMationById
* @Description: 删除矩阵单选题列选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
deleteQuestionChenColumnMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
option
=
dwSurveyDirectoryDao
.
queryQuestionChenColumnById
(
map
);
if
(
option
!=
null
){
if
(
option
.
get
(
"surveyState"
).
toString
().
equals
(
"0"
)){
//设计状态
dwSurveyDirectoryDao
.
deleteQuestionChenColumnMationById
(
map
);
//执行物理删除
}
else
{
//执行中或者结束
dwSurveyDirectoryDao
.
deleteLogicQuestionChenColumnMationById
(
map
);
//执行逻辑删除问题
}
}
}
/**
*
* @Title: deleteQuestionChenRowMationById
* @Description: 删除矩阵单选题行选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
deleteQuestionChenRowMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
option
=
dwSurveyDirectoryDao
.
queryQuestionChenRowById
(
map
);
if
(
option
!=
null
){
if
(
option
.
get
(
"surveyState"
).
toString
().
equals
(
"0"
)){
//设计状态
dwSurveyDirectoryDao
.
deleteQuestionChenRowMationById
(
map
);
//执行物理删除
}
else
{
//执行中或者结束
dwSurveyDirectoryDao
.
deleteLogicQuestionChenRowMationById
(
map
);
//执行逻辑删除问题
}
}
}
}
skyeye-promote/src/main/resources/dbmapper/DwSurveyDirectoryMapper.xml
浏览文件 @
8c065bd1
...
...
@@ -437,6 +437,7 @@
dw_survey_directory b
WHERE a.id = #{quId}
AND a.visibility = '1'
AND b.visibility = '1'
AND a.belong_id = b.id
</select>
...
...
@@ -473,4 +474,68 @@
AND belong_id = #{belongId}
</update>
<select
id=
"queryQuestionChenColumnById"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
c.survey_state surveyState
FROM
dw_qu_chen_column a,
dw_question b,
dw_survey_directory c
WHERE a.id = #{quItemId}
AND a.visibility = '1'
AND a.qu_id = b.id
AND b.visibility = '1'
AND c.visibility = '1'
AND b.belong_id = c.id
</select>
<update
id=
"deleteLogicQuestionChenColumnMationById"
parameterType=
"java.util.Map"
>
UPDATE dw_qu_chen_column
<set>
visibility = '0',
</set>
WHERE id = #{quItemId}
</update>
<delete
id=
"deleteQuestionChenColumnMationById"
parameterType=
"java.util.Map"
>
DELETE
FROM
dw_qu_chen_column
WHERE
id = #{quItemId}
</delete>
<select
id=
"queryQuestionChenRowById"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
c.survey_state surveyState
FROM
dw_qu_chen_row a,
dw_question b,
dw_survey_directory c
WHERE a.id = #{quItemId}
AND a.visibility = '1'
AND a.qu_id = b.id
AND b.visibility = '1'
AND c.visibility = '1'
AND b.belong_id = c.id
</select>
<update
id=
"deleteLogicQuestionChenRowMationById"
parameterType=
"java.util.Map"
>
UPDATE dw_qu_chen_row
<set>
visibility = '0',
</set>
WHERE id = #{quItemId}
</update>
<delete
id=
"deleteQuestionChenRowMationById"
parameterType=
"java.util.Map"
>
DELETE
FROM
dw_qu_chen_row
WHERE
id = #{quItemId}
</delete>
</mapper>
\ No newline at end of file
skyeye-promote/src/main/resources/mapping/reqdwsurvey.xml
浏览文件 @
8c065bd1
...
...
@@ -163,6 +163,12 @@
<url
id=
"dwsurveydirectory015"
path=
"/post/DwSurveyDirectoryController/deleteQuestionMationById"
val=
"删除问题"
allUse=
"1"
>
<property
id=
"quId"
name=
"quId"
ref=
"required"
var=
"问题id"
/>
</url>
<url
id=
"dwsurveydirectory016"
path=
"/post/DwSurveyDirectoryController/deleteQuestionChenColumnMationById"
val=
"删除矩阵单选题列选项"
allUse=
"1"
>
<property
id=
"quItemId"
name=
"quItemId"
ref=
"required"
var=
"选项id"
/>
</url>
<url
id=
"dwsurveydirectory017"
path=
"/post/DwSurveyDirectoryController/deleteQuestionChenRowMationById"
val=
"删除矩阵单选题行选项"
allUse=
"1"
>
<property
id=
"quItemId"
name=
"quItemId"
ref=
"required"
var=
"选项id"
/>
</url>
<!-- 问卷调查结束 -->
</controller>
\ No newline at end of file
skyeye-promote/src/main/resources/template/js/dwsurveydesign/dwsurveydesign.js
浏览文件 @
8c065bd1
...
...
@@ -1054,86 +1054,6 @@ layui.config({
}});
}
/** 添加列选项 **/
function
addChenItem
(
eventObj
,
quItemBody
,
itemText
){
var
eventObjClass
=
eventObj
.
attr
(
"
class
"
);
if
(
eventObjClass
.
indexOf
(
"
Column
"
)
>=
0
){
return
addChenColumnItem
(
quItemBody
,
itemText
);
}
else
{
return
addChenRowItem
(
quItemBody
,
itemText
);
}
}
/** 添加矩阵单选题列选项 **/
function
addChenColumnItem
(
quItemBody
,
itemText
){
//得判断是否是table类型
var
newEditObj
=
null
;
//ul li处理
var
quRadioColumnHtml
=
$
(
"
#quChenColumnModel
"
).
html
();
var
quCoChenTable
=
quItemBody
.
find
(
"
table.quCoChenTable
"
);
var
quCoChenTableTrs
=
quCoChenTable
.
find
(
"
tr
"
);
var
quType
=
quItemBody
.
find
(
"
input[name='quType']
"
).
val
();
$
.
each
(
quCoChenTableTrs
,
function
(
i
){
if
(
i
==
0
){
$
(
this
).
append
(
quRadioColumnHtml
);
}
else
{
if
(
quType
==
"
CHENRADIO
"
){
$
(
this
).
append
(
"
<td><input type='radio'> </td>
"
);
}
else
if
(
quType
==
"
CHENCHECKBOX
"
){
$
(
this
).
append
(
"
<td><input type='checkbox'> </td>
"
);
}
else
if
(
quType
==
"
CHENFBK
"
){
$
(
this
).
append
(
"
<td><input type='text'> </td>
"
);
}
else
if
(
quType
==
"
CHENSCORE
"
){
$
(
this
).
append
(
"
<td>评分</td>
"
);
}
}
});
quItemBody
.
find
(
"
input[name='saveTag']
"
).
val
(
0
);
newEditObj
=
quCoChenTable
.
find
(
"
tr:first .editAble:last
"
);
newEditObj
.
text
(
itemText
);
if
(
itemText
==
""
){
newEditObj
.
css
(
"
display
"
,
"
inline
"
);
}
return
newEditObj
;
}
//添加矩阵单选题行选项
function
addChenRowItem
(
quItemBody
,
itemText
){
//得判断是否是table类型
var
newEditObj
=
null
;
//ul li处理
var
quChenRowHtml
=
$
(
"
#quChenRowModel
"
).
html
();
var
quCoChenTable
=
quItemBody
.
find
(
"
table.quCoChenTable
"
);
var
quCoChenTableTds
=
quCoChenTable
.
find
(
"
tr:first td
"
);
var
quType
=
quItemBody
.
find
(
"
input[name='quType']
"
).
val
();
var
appendTrHtml
=
"
<tr>
"
;
$
.
each
(
quCoChenTableTds
,
function
(
i
){
if
(
i
==
0
){
appendTrHtml
+=
quChenRowHtml
;
}
else
{
if
(
quType
==
"
CHENRADIO
"
){
appendTrHtml
+=
"
<td><input type='radio'> </td>
"
;
}
else
if
(
quType
==
"
CHENCHECKBOX
"
){
appendTrHtml
+=
"
<td><input type='checkbox'> </td>
"
;
}
else
if
(
quType
==
"
CHENFBK
"
){
appendTrHtml
+=
"
<td><input type='text'> </td>
"
;
}
else
if
(
quType
==
"
CHENSCORE
"
){
appendTrHtml
+=
"
<td>评分</td>
"
;
}
}
});
appendTrHtml
+=
"
</tr>
"
;
quCoChenTable
.
append
(
appendTrHtml
);
quItemBody
.
find
(
"
input[name='saveTag']
"
).
val
(
0
);
newEditObj
=
quCoChenTable
.
find
(
"
tr:last .editAble
"
);
newEditObj
.
text
(
itemText
);
if
(
itemText
==
""
){
newEditObj
.
css
(
"
display
"
,
"
inline
"
);
}
return
newEditObj
;
}
//删除矩陈单选题选项
function
deleteChenOption
(){
var
curEditTd
=
$
(
curEditObj
).
parents
(
"
td
"
);
...
...
@@ -1144,238 +1064,45 @@ layui.config({
deleteChenRowOption
();
}
}
/** 删除矩阵单选题列选项 **/
/**
* 删除矩阵单选题列选项
*/
function
deleteChenColumnOption
(){
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenColumnTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
quOptionId
!=
""
&&
quOptionId
!=
"
0
"
){
var
url
=
reqBasePath
+
"
/design/qu-chen!ajaxDeleteColumn.action
"
;
var
data
=
"
quItemId=
"
+
quOptionId
;
$
.
ajax
({
url
:
url
,
data
:
data
,
type
:
"
post
"
,
success
:
function
(
msg
){
if
(
msg
==
"
true
"
){
delQuOptionCallBack
(
optionParent
);
}
}
});
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenColumnTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
!
isNull
(
quOptionId
)
&&
quOptionId
!=
"
0
"
){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
dwsurveydirectory016
"
,
params
:{
quItemId
:
quOptionId
},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
delQuOptionCallBack
(
optionParent
);
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
else
{
delQuOptionCallBack
(
optionParent
);
}
}
/** 删除矩阵单选题行选项 **/
/**
* 删除矩阵单选题行选项
*/
function
deleteChenRowOption
(){
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenRowTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
quOptionId
!=
""
&&
quOptionId
!=
"
0
"
){
var
url
=
reqBasePath
+
"
/design/qu-chen!ajaxDeleteRow.action
"
;
var
data
=
"
quItemId=
"
+
quOptionId
;
$
.
ajax
({
url
:
url
,
data
:
data
,
type
:
"
post
"
,
success
:
function
(
msg
){
if
(
msg
==
"
true
"
){
delQuOptionCallBack
(
optionParent
);
}
}
});
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenRowTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
!
isNull
(
quOptionId
)
&&
quOptionId
!=
"
0
"
){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
dwsurveydirectory017
"
,
params
:{
quItemId
:
quOptionId
},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
delQuOptionCallBack
(
optionParent
);
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
else
{
delQuOptionCallBack
(
optionParent
);
}
}
/**逻辑设置**/
//添加逻辑选项
function
addQuDialogLogicTr
(
autoClass
,
trueCallback
,
falseCallback
){
//当前题的选项
var
quItemBody
=
$
(
dwDialogObj
).
parents
(
"
.surveyQuItemBody
"
);
var
quItemInputCases
=
quItemBody
.
find
(
"
.quItemInputCase
"
);
var
quLogicInputCase
=
quItemBody
.
find
(
"
.quLogicInputCase
"
);
var
curQuId
=
quItemBody
.
find
(
"
input[name='quId']
"
).
val
();
var
quType
=
quItemBody
.
find
(
"
input[name='quType']
"
).
val
();
var
logicQuOptionSels
=
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuOptionSel
"
);
var
dwLogicQuSels
=
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuSel
"
);
//判断有无选项任意选项
var
executeTag
=
true
;
$
.
each
(
logicQuOptionSels
,
function
(){
var
selOptionVal
=
$
(
this
).
val
();
if
(
selOptionVal
==
"
0
"
){
executeTag
=
false
;
return
false
;
}
});
if
(
executeTag
){
var
appendTrHtml
=
$
(
"
#setQuLogicItemTrModel
"
).
html
();
if
(
quType
===
"
SCORE
"
){
appendTrHtml
=
$
(
"
#setQuLogicItemTrModel_score
"
).
html
();
}
$
(
"
#dwQuLogicTable
"
).
append
(
"
<tr>
"
+
appendTrHtml
+
"
</tr>
"
);
var
lastTr
=
$
(
"
#dwQuLogicTable
"
).
find
(
"
tr
"
).
last
();
if
(
quType
===
"
FILLBLANK
"
){
lastTr
.
find
(
"
.ifSpanText1
"
).
text
(
"
如果回答
"
);
}
if
(
autoClass
){
var
quLogicItemNum
=
quLogicInputCase
.
find
(
"
input[name='quLogicItemNum']
"
);
var
newQuLogicItemNum
=
(
parseInt
(
quLogicItemNum
.
val
())
+
1
);
quLogicItemNum
.
val
(
newQuLogicItemNum
);
var
newQuLogicItemClass
=
"
quLogicItem_
"
+
newQuLogicItemNum
;
lastTr
.
attr
(
"
class
"
,
newQuLogicItemClass
);
}
var
dwQuOptionSel
=
lastTr
.
find
(
"
.logicQuOptionSel
"
);
var
eachTag
=
true
;
if
(
quType
===
"
CHENRADIO
"
||
quType
===
"
CHENCHECKBOX
"
||
quType
===
"
CHENSCORE
"
||
quType
===
"
CHENFBK
"
){
var
quChenColumnTds
=
quItemBody
.
find
(
"
.quChenColumnTd
"
);
var
quChenRowTds
=
quItemBody
.
find
(
"
.quChenRowTd
"
);
$
.
each
(
quChenRowTds
,
function
(){
var
rowText
=
$
(
this
).
find
(
"
.quCoOptionEdit
"
).
text
();
var
rowQuItemId
=
$
(
this
).
find
(
"
input[name='quItemId']
"
).
val
();
$
.
each
(
quChenColumnTds
,
function
(){
var
colText
=
$
(
this
).
find
(
"
.quCoOptionEdit
"
).
text
();
var
colQuItemId
=
$
(
this
).
find
(
"
input[name='quItemId']
"
).
val
();
var
optionId
=
rowQuItemId
+
"
:
"
+
colQuItemId
;
eachTag
=
true
;
$
.
each
(
logicQuOptionSels
,
function
(){
var
selOptionVal
=
$
(
this
).
val
();
if
(
selOptionVal
==
optionId
){
eachTag
=
false
;
return
false
;
}
});
if
(
eachTag
){
dwQuOptionSel
.
append
(
"
<option value='
"
+
optionId
+
"
'>
"
+
rowText
+
"
:
"
+
colText
+
"
</option>
"
);
}
});
});
}
else
{
$
.
each
(
quItemInputCases
,
function
(){
var
optionText
=
$
(
this
).
parent
().
find
(
"
label.quCoOptionEdit
"
).
text
();
var
optionId
=
$
(
this
).
find
(
"
input[name='quItemId']
"
).
val
();
eachTag
=
true
;
$
.
each
(
logicQuOptionSels
,
function
(){
var
selOptionVal
=
$
(
this
).
val
();
if
(
selOptionVal
==
optionId
){
eachTag
=
false
;
return
false
;
}
});
if
(
eachTag
){
dwQuOptionSel
.
append
(
"
<option value='
"
+
optionId
+
"
'>
"
+
optionText
+
"
</option>
"
);
}
});
}
if
(
logicQuOptionSels
.
size
()
==
0
){
dwQuOptionSel
.
append
(
"
<option value='0'>任意选项</option>
"
);
}
else
{
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuOptionSel option[value='0']
"
).
remove
();
}
if
(
quType
===
"
FILLBLANK
"
){
dwQuOptionSel
.
val
(
"
0
"
);
}
var
logicQuSel
=
lastTr
.
find
(
"
.logicQuSel
"
);
var
quItemBodys
=
$
(
"
#dwSurveyQuContent .surveyQuItemBody
"
);
$
.
each
(
quItemBodys
,
function
(){
if
(
$
(
this
).
find
(
"
.quCoTitleEdit
"
)[
0
]){
var
quCoNumText
=
$
(
this
).
find
(
"
.quCoNum
"
).
text
();
var
quTitleText
=
$
(
this
).
find
(
"
.quCoTitleEdit
"
).
text
();
var
quId
=
$
(
this
).
find
(
"
input[name='quId']
"
).
val
();
eachTag
=
true
;
if
(
curQuId
==
quId
){
eachTag
=
false
;
}
if
(
eachTag
){
$
.
each
(
dwLogicQuSels
,
function
(){
var
dwLogicQuSelVal
=
$
(
this
).
val
();
if
(
dwLogicQuSelVal
==
quId
){
eachTag
=
false
;
return
false
;
}
});
}
if
(
eachTag
){
logicQuSel
.
append
(
"
<option value='
"
+
quId
+
"
'>
"
+
quCoNumText
+
quTitleText
+
"
</option>
"
);
}
}
});
logicQuSel
.
append
(
"
<option value='1'>正常结束(计入结果)</option><option value='2'>提前结束(不计入结果)</option>
"
);
if
(
quType
===
"
SCORE
"
){
var
logicScoreNum
=
lastTr
.
find
(
"
.logicScoreNum
"
);
logicScoreNum
.
empty
();
for
(
var
i
=
1
;
i
<=
10
;
i
++
){
logicScoreNum
.
append
(
"
<option value=
\"
"
+
i
+
"
\"
>
"
+
i
+
"
</option>
"
);
}
}
else
if
(
quType
===
"
ORDERQU
"
){
dwQuOptionSel
.
empty
();
dwQuOptionSel
.
append
(
"
<option value='0'>回答完成</option>
"
);
lastTr
.
find
(
"
.ifSpanText1
"
).
text
(
"
如果本题
"
);
}
if
(
autoClass
){
logicQuSel
.
prepend
(
"
<option value=''>-请选择题目-</option>
"
);
dwQuOptionSel
.
prepend
(
"
<option value=''>-请选择选项-</option>
"
);
}
bindDialogRemoveLogic
();
trueCallback
();
}
else
{
falseCallback
();
}
}
//绑定逻辑设置中选项删除事件
function
bindDialogRemoveLogic
(){
$
(
"
.dialogRemoveLogic
"
).
unbind
();
$
(
"
.dialogRemoveLogic
"
).
click
(
function
(){
var
logicItemTr
=
$
(
this
).
parents
(
"
tr
"
);
var
logicItemTrClass
=
logicItemTr
.
attr
(
"
class
"
);
//同时移除页面只保存的信息--注意如果已经保存到库中,修改
var
quItemBody
=
$
(
dwDialogObj
).
parents
(
"
.surveyQuItemBody
"
);
var
quLogicItem
=
quItemBody
.
find
(
"
.
"
+
logicItemTrClass
);
if
(
quLogicItem
[
0
]){
//有则判断,是否已经加入到数据库
var
quLogicIdVal
=
quLogicItem
.
find
(
"
input[name='quLogicId']
"
).
val
();
if
(
quLogicIdVal
!=
""
){
quLogicItem
.
find
(
"
input[name='visibility']
"
).
val
(
0
);
quLogicItem
.
find
(
"
input[name='logicSaveTag']
"
).
val
(
0
);
quItemBody
.
find
(
"
input[name='saveTag']
"
).
val
(
0
);
}
else
{
quLogicItem
.
remove
();
}
//更新select option信息
var
logicQuOptionSel
=
logicItemTr
.
find
(
"
.logicQuOptionSel option:selected
"
);
var
logicQuSel
=
logicItemTr
.
find
(
"
.logicQuSel option:selected
"
);
if
(
logicQuOptionSel
.
val
()
!=
""
){
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuOptionSel
"
).
append
(
"
<option value='
"
+
logicQuOptionSel
.
val
()
+
"
'>
"
+
logicQuOptionSel
.
text
()
+
"
</option>
"
);
}
if
(
logicQuSel
.
val
()
!=
""
){
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuSel
"
).
append
(
"
<option value='
"
+
logicQuSel
.
val
()
+
"
'>
"
+
logicQuSel
.
text
()
+
"
</option>
"
);
}
}
logicItemTr
.
remove
();
refreshQuLogicInfo
(
quItemBody
);
return
false
;
});
$
(
"
.logicQuSel
"
).
unbind
();
$
(
"
.logicQuSel
"
).
change
(
function
(){
var
thVal
=
$
(
this
).
val
();
//当题目选项中选项 提前结束,或正常结束,则不作处理
if
(
thVal
!==
"
1
"
&&
thVal
!==
"
2
"
){
//移除前面选项中存在的当前被选择的选项
$
(
"
#dwQuLogicTable
"
).
find
(
"
.logicQuSel
"
).
not
(
this
).
find
(
"
option[value='
"
+
thVal
+
"
']
"
).
remove
();
}
});
}
//刷新每题的逻辑显示数目
function
refreshQuLogicInfo
(
quItemBody
){
var
quLogicItems
=
quItemBody
.
find
(
"
.quLogicItem input[name='visibility'][value='1']
"
);
var
quLogicItemSize
=
quLogicItems
.
size
();
quItemBody
.
find
(
"
.quLogicInfo
"
).
text
(
quLogicItemSize
);
}
//显示弹出层
function
showDialog
(
thDialogObj
){
var
thObjClass
=
thDialogObj
.
attr
(
"
class
"
);
...
...
@@ -2833,61 +2560,7 @@ layui.config({
}
return
newEditObj
;
}
//删除矩陈单选题选项
function
deleteChenOption
()
{
var
curEditTd
=
$
(
curEditObj
).
parents
(
"
td
"
);
var
curEditTdClass
=
curEditTd
.
attr
(
"
class
"
);
if
(
curEditTdClass
.
indexOf
(
"
Column
"
)
>=
0
)
{
deleteChenColumnOption
();
}
else
{
deleteChenRowOption
();
}
}
/** 删除矩阵单选题列选项 **/
function
deleteChenColumnOption
()
{
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenColumnTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
quOptionId
!=
""
&&
quOptionId
!=
"
0
"
)
{
var
url
=
reqBasePath
+
"
/design/qu-chen!ajaxDeleteColumn.action
"
;
var
data
=
"
quItemId=
"
+
quOptionId
;
$
.
ajax
({
url
:
url
,
data
:
data
,
type
:
"
post
"
,
success
:
function
(
msg
)
{
if
(
msg
==
"
true
"
)
{
delQuOptionCallBack
(
optionParent
);
}
}
});
}
else
{
delQuOptionCallBack
(
optionParent
);
}
}
/** 删除矩阵单选题行选项 **/
function
deleteChenRowOption
()
{
var
optionParent
=
null
;
optionParent
=
$
(
curEditObj
).
parents
(
"
td.quChenRowTd
"
);
var
quOptionId
=
$
(
optionParent
).
find
(
"
input[name='quItemId']
"
).
val
();
if
(
quOptionId
!=
""
&&
quOptionId
!=
"
0
"
)
{
var
url
=
reqBasePath
+
"
/design/qu-chen!ajaxDeleteRow.action
"
;
var
data
=
"
quItemId=
"
+
quOptionId
;
$
.
ajax
({
url
:
url
,
data
:
data
,
type
:
"
post
"
,
success
:
function
(
msg
)
{
if
(
msg
==
"
true
"
)
{
delQuOptionCallBack
(
optionParent
);
}
}
});
}
else
{
delQuOptionCallBack
(
optionParent
);
}
}
/**逻辑设置**/
//添加逻辑选项
function
addQuDialogLogicTr
(
autoClass
,
trueCallback
,
falseCallback
)
{
...
...
@@ -3088,15 +2761,6 @@ layui.config({
}
}
function
setSelectText
(
el
)
{
try
{
window
.
getSelection
().
selectAllChildren
(
el
[
0
]);
//全选
window
.
getSelection
().
collapseToEnd
(
el
[
0
]);
//光标置后
}
catch
(
err
)
{
//在此处理错误
}
}
function
validateGen
()
{
$
(
"
#dwCommonDialogForm
"
).
validate
({
rules
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录