Przeglądaj źródła

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 7 lat temu
rodzic
commit
0e486313f4

+ 18 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecordDO.java

@@ -33,6 +33,24 @@ public class OutInRecordDO implements Serializable {
 	private Long stuId;
 	//学校
 	private Long schoolId;
+	//设备号
+	private String deviceId;
+	//学号
+	private String stuNumber;
+	//学生姓名
+	private String stuName;
+	//年级id
+	private Long gradeId;
+	//年级名
+	private String gradeName;
+	//班级id
+	private Long clazzId;
+	//班级名
+	private String clazzName;
+	//年级-班级
+	private String gradeClazz;
+	//学生性别 1男  2女
+	private Integer stuSex;
 
 
 }

+ 20 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java

@@ -3,8 +3,8 @@ package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.usoftchina.smartschool.school.po.*;
-import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxPrincipalMailboxService;
+import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.utils.JavaBeanUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
@@ -42,6 +42,15 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 	@Autowired
 	private WxTemplateMapper wxTemplateMapper;
 
+	@Autowired
+	private WxStudentMapper wxStudentMapper;
+
+	@Autowired
+	private WxClazzMapper wxClazzMapper;
+
+	@Autowired
+	private WxGradeMapper wxGradeMapper;
+
 	/**
 	 * 校长信箱创建
 	 * @return
@@ -51,8 +60,18 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 		PrincipalMailboxDO principalMailboxDO = JSONObject.parseObject(mailboxString, PrincipalMailboxDO.class);
 		Long schoolId = parentsMapper.get(principalMailboxDO.getMailboxCreator()).getSchoolId();
 		principalMailboxDO.setNotifier(schoolMapper.get(schoolId).getTeacherId());
+		principalMailboxDO.setMbCreatorname(parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName());
 		principalMailboxDO.setSchoolId(schoolId);
 		principalMailboxDO.setCreateDate(new Date());
+		StudentDO studentDO = wxStudentMapper.get(principalMailboxDO.getMbStuid());
+		if (ObjectUtils.isNotEmpty(studentDO)){
+			principalMailboxDO.setMbStudent(studentDO.getStuName());
+			ClazzDO clazzDO = wxClazzMapper.get(studentDO.getClazzId());
+			principalMailboxDO.setMbClass(clazzDO.getClazzName());
+			principalMailboxDO.setMbGrade(wxGradeMapper.get(clazzDO.getGradeId()).getGradeName());
+		}
+
+
 		int save = principalMailboxMapper.save(principalMailboxDO);
 		if (save>0){
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

+ 44 - 34
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java

@@ -220,21 +220,26 @@ public class WxUserServiceImpl implements WxUserService {
 		if (ObjectUtils.isNotEmpty(teacherClazzDOS)){
 			for (TeacherClazzDO tc:teacherClazzDOS) {
 				ClazzDO clazzDO = clazzMapper.get(tc.getClazzId());
-				Map<String, Object> clazzMap = JavaBeanUtil.object2Map(clazzDO);
-				clazzMap.put("gradeName",gradeMapper.get(clazzDO.getGradeId()).getGradeName());
-				Map<String, Object> map = new HashMap<>();
-				map.put("clazzId",clazzDO.getClazzId());
-				List<StudentDO> studentDOS = studentMapper.list(map);
-				List<TeacherClazzDO> list = teacherClazzMapper.list(map);
-				List<TeacherDO> teacherDOS = new ArrayList<>();
-				for (TeacherClazzDO teacherClazzDO:list) {
-					TeacherDO teacherDO = teacherMapper.get(teacherClazzDO.getTeacherId());
-					teacherDO.setUserPhone(userMapper.get(teacherDO.getUserId()).getUserPhone());
-					teacherDOS.add(teacherDO);
+				if (ObjectUtils.isNotEmpty(clazzDO)){
+					Map<String, Object> clazzMap = JavaBeanUtil.object2Map(clazzDO);
+					clazzMap.put("gradeName",gradeMapper.get(clazzDO.getGradeId()).getGradeName());
+					Map<String, Object> map = new HashMap<>();
+					map.put("clazzId",clazzDO.getClazzId());
+					List<StudentDO> studentDOS = studentMapper.list(map);
+					List<TeacherClazzDO> list = teacherClazzMapper.list(map);
+					if (ObjectUtils.isNotEmpty(studentDOS)){
+						List<TeacherDO> teacherDOS = new ArrayList<>();
+						for (TeacherClazzDO teacherClazzDO:list) {
+							TeacherDO teacherDO = teacherMapper.get(teacherClazzDO.getTeacherId());
+							teacherDO.setUserPhone(userMapper.get(teacherDO.getUserId()).getUserPhone());
+							teacherDOS.add(teacherDO);
+						}
+						clazzMap.put("studentDOS",removeDuplicate(studentDOS));
+						clazzMap.put("teacherDOS",removeDuplicate(teacherDOS));
+						maps.add(clazzMap);
+					}
 				}
-				clazzMap.put("studentDOS",removeDuplicate(studentDOS));
-				clazzMap.put("teacherDOS",removeDuplicate(teacherDOS));
-				maps.add(clazzMap);
+
 			}
 			return maps;
 		}else {
@@ -410,25 +415,14 @@ public class WxUserServiceImpl implements WxUserService {
 	 * @throws Exception
 	 */
 	public int updatePhone(String userPhone, String openid, String code) throws Exception {
-		Map<String, Object> map = new HashMap<>();
-		map.put("openid",openid);
-		List<ParentsDO> parentsDOS = parentsMapper.list(map);
-		List<TeacherDO> teacherDOS = teacherMapper.list(map);
-		if (ObjectUtils.isNotEmpty(parentsDOS)){
-			UserDO userDO = userMapper.get(parentsDOS.get(0).getUserId());
-			if (ObjectUtils.isNotEmpty(userDO)) {
-				if (code.equals(userDO.getUserCode())) {
-					userDO.setUserPhone(userPhone);
-					return userMapper.update(userDO);
-				}else {
-					throw new Exception("验证码错误,请核实");
-				}
-			}else {
-				throw new Exception("用户不存在,请联系管理员");
-			}
-		}else {
-			if (ObjectUtils.isNotEmpty(teacherDOS)){
-				UserDO userDO = userMapper.get(teacherDOS.get(0).getUserId());
+		UserDO user = userMapper.selectUserByPhone(userPhone);
+		if (ObjectUtils.isEmpty(user)){
+			Map<String, Object> map = new HashMap<>();
+			map.put("openid",openid);
+			List<ParentsDO> parentsDOS = parentsMapper.list(map);
+			List<TeacherDO> teacherDOS = teacherMapper.list(map);
+			if (ObjectUtils.isNotEmpty(parentsDOS)){
+				UserDO userDO = userMapper.get(parentsDOS.get(0).getUserId());
 				if (ObjectUtils.isNotEmpty(userDO)) {
 					if (code.equals(userDO.getUserCode())) {
 						userDO.setUserPhone(userPhone);
@@ -440,8 +434,24 @@ public class WxUserServiceImpl implements WxUserService {
 					throw new Exception("用户不存在,请联系管理员");
 				}
 			}else {
-				throw new Exception("用户不存在,请联系管理员");
+				if (ObjectUtils.isNotEmpty(teacherDOS)){
+					UserDO userDO = userMapper.get(teacherDOS.get(0).getUserId());
+					if (ObjectUtils.isNotEmpty(userDO)) {
+						if (code.equals(userDO.getUserCode())) {
+							userDO.setUserPhone(userPhone);
+							return userMapper.update(userDO);
+						}else {
+							throw new Exception("验证码错误,请核实");
+						}
+					}else {
+						throw new Exception("用户不存在,请联系管理员");
+					}
+				}else {
+					throw new Exception("用户不存在,请联系管理员");
+				}
 			}
+		}else {
+			throw new Exception("该手机号已绑定用户,请联系管理员");
 		}
 	}
 

+ 1 - 14
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxOutInRecordMapper.java

@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 出入校通知表; InnoDB free: 5120 kB
@@ -17,18 +16,6 @@ import java.util.Map;
 public interface WxOutInRecordMapper {
 
 	OutInRecordDO get(Long recordId);
-	
-	List<OutInRecordDO> list(Map<String, Object> map);
-	
-	int count(Map<String, Object> map);
-	
-	int save(OutInRecordDO outInRecord);
-	
-	int update(OutInRecordDO outInRecord);
-	
-	int remove(Long record_id);
-	
-	int batchRemove(Long[] recordIds);
 
-	public List<OutInRecordDO> selectOutInRecordDOListByStuId(@Param("stuId") Long stuId, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);
+	List<OutInRecordDO> selectOutInRecordDOListByStuId(@Param("stuId") Long stuId, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);
 }

+ 1 - 88
applications/school/school-server/src/main/resources/mapper/WxOutInRecordMapper.xml

@@ -4,100 +4,13 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxOutInRecordMapper">
 
     <sql id="OutInRecordVo">
-    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id` from out_in_record
+    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id`,`device_id`,`stu_number`,`stu_name`,`grade_id`,`grade_name`,`clazz_id`,`clazz_name`,`grade_clazz`,`stu_sex` from out_in_record
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
 		<include refid="OutInRecordVo"/> where record_id = #{value}
 	</select>
 
-	<select id="list" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
-        <include refid="OutInRecordVo"/>
-        <where>  
-		  		  <if test="recordId != null and recordId != ''"> and record_id = #{recordId} </if>
-		  		  <if test="recordName != null and recordName != ''"> and record_name = #{recordName} </if>
-		  		  <if test="outDate != null and outDate != ''"> and out_date = #{outDate} </if>
-		  		  <if test="inDate != null and inDate != ''"> and in_date = #{inDate} </if>
-		  		  <if test="recordDetails != null and recordDetails != ''"> and record_details = #{recordDetails} </if>
-		  		  <if test="recordRemarks != null and recordRemarks != ''"> and record_remarks = #{recordRemarks} </if>
-		  		  <if test="stuId != null and stuId != ''"> and stu_id = #{stuId} </if>
-		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
-		  		</where>
-        <choose>
-            <when test="sort != null and sort.trim() != ''">
-                order by ${sort} ${order}
-            </when>
-			<otherwise>
-                order by record_id desc
-			</otherwise>
-        </choose>
-		<if test="offset != null and limit != null">
-			limit #{offset}, #{limit}
-		</if>
-	</select>
-	
- 	<select id="count" resultType="int">
-		select count(*) from out_in_record
-		 <where>  
-		  		  <if test="recordId != null and recordId != ''"> and record_id = #{recordId} </if>
-		  		  <if test="recordName != null and recordName != ''"> and record_name = #{recordName} </if>
-		  		  <if test="outDate != null and outDate != ''"> and out_date = #{outDate} </if>
-		  		  <if test="inDate != null and inDate != ''"> and in_date = #{inDate} </if>
-		  		  <if test="recordDetails != null and recordDetails != ''"> and record_details = #{recordDetails} </if>
-		  		  <if test="recordRemarks != null and recordRemarks != ''"> and record_remarks = #{recordRemarks} </if>
-		  		  <if test="stuId != null and stuId != ''"> and stu_id = #{stuId} </if>
-		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
-		  		</where>
-	</select>
-	 
-	<insert id="save" parameterType="com.usoftchina.smartschool.school.po.OutInRecordDO" useGeneratedKeys="true" keyProperty="recordId">
-		insert into out_in_record
-		(
-			`record_name`, 
-			`out_date`, 
-			`in_date`, 
-			`record_details`, 
-			`record_remarks`, 
-			`stu_id`, 
-			`school_id`
-		)
-		values
-		(
-			#{recordName}, 
-			#{outDate}, 
-			#{inDate}, 
-			#{recordDetails}, 
-			#{recordRemarks}, 
-			#{stuId}, 
-			#{schoolId}
-		)
-	</insert>
-	 
-	<update id="update" parameterType="com.usoftchina.smartschool.school.po.OutInRecordDO">
-		update out_in_record 
-		<set>
-			<if test="recordName != null">`record_name` = #{recordName}, </if>
-			<if test="outDate != null">`out_date` = #{outDate}, </if>
-			<if test="inDate != null">`in_date` = #{inDate}, </if>
-			<if test="recordDetails != null">`record_details` = #{recordDetails}, </if>
-			<if test="recordRemarks != null">`record_remarks` = #{recordRemarks}, </if>
-			<if test="stuId != null">`stu_id` = #{stuId}, </if>
-			<if test="schoolId != null">`school_id` = #{schoolId}</if>
-		</set>
-		where record_id = #{recordId}
-	</update>
-	
-	<delete id="remove">
-		delete from out_in_record where record_id = #{value}
-	</delete>
-	
-	<delete id="batchRemove">
-		delete from out_in_record where record_id in 
-		<foreach item="recordId" collection="array" open="(" separator="," close=")">
-			#{recordId}
-		</foreach>
-	</delete>
-
 	<select id="selectOutInRecordDOListByStuId" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
 		<include refid="OutInRecordVo"/> where stu_id = #{stuId}
 		order by record_id desc

+ 0 - 70
applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/controller/MessageLogControllerTest.java

@@ -1,70 +0,0 @@
-package com.usoftchina.smartschool.school.controller;
-
-import com.github.pagehelper.PageInfo;
-import com.usoftchina.smartschool.base.Result;
-import com.usoftchina.smartschool.context.BaseContextHolder;
-import com.usoftchina.smartschool.school.dto.DocBaseDTO;
-import com.usoftchina.smartschool.test.BaseControllerTest;
-import com.usoftchina.smartschool.utils.JsonUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.MvcResult;
-
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-@EnableAutoConfiguration
-public class MessageLogControllerTest extends BaseControllerTest {
-
-    private static final String CODE = "Curriculum";
-    private static final String NAME = "课程表";
-
-    @Test
-    public void testA_getListData() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        MvcResult mvcResult = mockMvc.perform(get("/messagelog/list"))
-                .andExpect(isSuccess())
-                .andReturn();
-        Result<PageInfo> result = result(mvcResult, PageInfo.class);
-        System.out.println(JsonUtils.toJsonString(result.getData()));
-    }
-
-    @Test
-    public void testB_save() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/save", docBaseDTO));
-    }
-
-    @Test
-    public void testC_update() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/update", docBaseDTO));
-    }
-
-    @Test
-    public void testD_delete() throws Exception {
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        BaseContextHolder.setSchoolId(1L);
-        mockMvc.perform(requestBody("/messagelog/delete", docBaseDTO));
-    }
-
-    @Test
-    public void testE_deleteDetail() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/deleteDetail", docBaseDTO));
-    }
-
-    @Test
-    public void testF_customizeLog() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/customizeLog", docBaseDTO));
-    }
-
-}

+ 0 - 71
applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/service/CurriculumServiceTest.java

@@ -1,71 +0,0 @@
-package com.usoftchina.smartschool.school.service;
-
-import com.github.pagehelper.PageInfo;
-import com.usoftchina.smartschool.context.BaseContextHolder;
-import com.usoftchina.smartschool.page.PageRequest;
-import com.usoftchina.smartschool.school.basic.service.CurriculumService;
-import com.usoftchina.smartschool.school.dto.CurriculumFormDTO;
-import com.usoftchina.smartschool.school.dto.CurriculumListDTO;
-import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.utils.JsonUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-/**
- * @Description
- * @Author chenwei
- * @Date 2019/02/19
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-@EnableAutoConfiguration
-public class CurriculumServiceTest {
-
-    @Autowired
-    private CurriculumService curriculumService;
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(CurriculumServiceTest.class);
-
-    @Test
-    public void testA_selectAll(){
-        LOGGER.info("===============test selectAll start==============");
-        PageRequest pageRequest = new PageRequest(1, 8);
-        BaseContextHolder.setSchoolId(1);
-        PageInfo<CurriculumListDTO> pageInfo = curriculumService.selectAll(pageRequest, new ListReqDTO());
-        LOGGER.info("pageInfo={}", JsonUtils.toJsonString(pageInfo));
-        LOGGER.info("===============test selectAll end================");
-
-    }
-
-    @Test
-    public void testB_read(){
-        LOGGER.info("===============test read start==============");
-        CurriculumFormDTO curriculumFormDTO = curriculumService.read(1L);
-        LOGGER.info("curriculumFormDTO={}", JsonUtils.toJsonString(curriculumFormDTO));
-        LOGGER.info("===============test read end================");
-    }
-
-    @Test
-    public void testC_save(){
-        LOGGER.info("===============test save start==============");
-        LOGGER.info("===============test save end================");
-    }
-
-    @Test
-    public void testE_delete(){
-        LOGGER.info("===============test delete start==============");
-        LOGGER.info("===============test delete end================");
-    }
-
-    @Test
-    public void testF_deleteDetail(){
-        LOGGER.info("===============test deleteDetail start==============");
-        LOGGER.info("===============test deleteDetail end================");
-    }
-}

+ 2 - 2
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java

@@ -36,14 +36,14 @@ public class WxPushServiceImpl implements WxPushService{
                 params.put("grant_type", "client_credential");
                 HttpRequest httpRequest= HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token",params,false);
                 String content=httpRequest.body();
-                //System.err.println("getWxAccessTokenContent======"+content);
+                System.err.println("getWxAccessTokenContent======"+content);
                 String token= JSON.parseObject(content).getString("access_token");
                 //System.err.println("getWxAccessTokenToken====="+ token);
                 HttpRequest hRequest=  HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token)
                         .header("Content-Type", "application/json")
                         .send(json.getBytes());
                 String result= hRequest.body();
-                //System.err.println("WxPushResult======="+result);
+                System.err.println("WxPushResult======="+result);
 
 			/*if(JSON.parseObject(result).getInteger("errcode")==0&&JSON.parseObject(result).getString("errmsg").equals("ok")){
 				return "推送成功!";

+ 31 - 0
frontend/wechat-web/src/index.js

@@ -15,6 +15,37 @@ import 'moment/locale/zh-cn';
 
 moment.locale('zh-cn');
 
+//解决在某些内核版本较低的浏览器上会出现的Object.assign is not a function错误
+if (typeof Object.assign != 'function') {
+    // Must be writable: true, enumerable: false, configurable: true
+    Object.defineProperty(Object, "assign", {
+        value: function assign(target, varArgs) { // .length of function is 2
+            'use strict';
+            if (target == null) { // TypeError if undefined or null
+                throw new TypeError('Cannot convert undefined or null to object');
+            }
+
+            var to = Object(target);
+
+            for (var index = 1; index < arguments.length; index++) {
+                var nextSource = arguments[index];
+
+                if (nextSource != null) { // Skip over if undefined or null
+                    for (var nextKey in nextSource) {
+                        // Avoid bugs when hasOwnProperty is shadowed
+                        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
+                            to[nextKey] = nextSource[nextKey];
+                        }
+                    }
+                }
+            }
+            return to;
+        },
+        writable: true,
+        configurable: true
+    });
+}
+
 ReactDOM.render(<LocaleProvider locale={zh_CN}>
         <Provider store={store}>
             <PersistGate loading={null} persistor={persistor}>

+ 4 - 1
frontend/wechat-web/src/modules/hiPages/changephonenumber/ChangePhoneNumber.js

@@ -77,16 +77,19 @@ let mSeconds = 0;
              openid:this.props.userInfo.user.userOpenid,
              code:this.state.vCode,
          }
-         fetchPost(API.updatePhone,{params},{})
+         fetchPost(API.updatePhone,params,{})
              .then((response)=>{
                  console.log('response',response)
                  if(response.success){
+                     Toast.show("绑定成功")
                      this.setState({
                          changeSuccess:true
                      },function () {
                          // this.props.history.push('/homepage/')
                          this.props.history.goBack()
                      })
+                 }else {
+                     Toast.show("绑定失败")
                  }
              })
              .catch((error) =>{

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/send-vote/SelectItem.js

@@ -22,7 +22,7 @@ export default class SelectItem extends Component {
                     <textarea rows="1" ref='itemContent' type="text"
                               placeholder="请输入选项内容" value={this.props.itemata == null ? '' : this.props.itemata}
                               className="textarea_sty" style={{resize: 'none', width: '90%'}}/>
-                    {(this.props.index != 0 && this.props.index != 1) ?
+                    {(this.props.index > 1 ) ?
                         <Icon type="minus-circle" style={{fontSize: '17px', color: '#ff0a0a'}}
                               onClick={this.itemEmpty}/> : ''}
                 </div>

+ 0 - 2
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -19,8 +19,6 @@ import UploadEnclosure from '../../../components/UploadEnclosure';
 import {connect} from 'react-redux';
 import {clearListState} from "../../../redux/actions/listState";
 
-const Option = Select.Option;
-const {TextArea} = Input;
 
 class SendVote extends Component {
     componentWillMount() {