Quellcode durchsuchen

字数超出限制不成功

lifanagju_citu vor 3 Monaten
Ursprung
Commit
04ca760649

+ 6 - 5
components/RichEditor/index.vue

@@ -114,11 +114,12 @@
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
-			isExceedValidate(alert = false, isReturn = false, title = '字数超出限制') {
-				const bool = Boolean(this.max-0 && (this.currentWordCount-0 > this.max-0)) 
-				if (alert && bool) uni.showToast({ title, icon: 'none', duration: 2000 })
-				if (isReturn && bool) return true
-			},
+			// isExceedValidate(alert = false, isReturn = false, title = '字数超出限制') {
+			// 	const bool = Boolean(this.max-0 && (this.currentWordCount-0 > this.max-0)) 
+			// 	if (alert && bool) uni.showToast({ title, icon: 'none', duration: 2000 })
+			// 	console.log('字数超出限制:', bool)
+			// 	if (isReturn && bool) return true
+			// },
 			handleBlur() {
 			handleBlur() {
 				this.editorCtx.getContents({
 				this.editorCtx.getContents({
 					success: (res) => {
 					success: (res) => {

+ 3 - 2
components/positionItem/components/baseInfo.vue

@@ -142,8 +142,6 @@ const soFar = ref(props.data?.expireTime === null ? [1] : [])
 const getQuery = async () => {
 const getQuery = async () => {
   const valid = await unref(form).validate()
   const valid = await unref(form).validate()
   if (!valid) return
   if (!valid) return
-  contentRef.value?.isExceedValidate(true, true, '岗位职责字数超出限制')
-  requirementValid.value?.isExceedValidate(true, true, '岗位要求字数超出限制')
 
 
   const obj = {
   const obj = {
     hirePrice: 0,
     hirePrice: 0,
@@ -152,6 +150,9 @@ const getQuery = async () => {
     ...formData.value
     ...formData.value
   }
   }
 
 
+  // obj.contentLength = contentRef.value?.currentWordCount || 0
+  // obj.requirementLength = requirementValid.value?.currentWordCount || 0
+
   obj.expireTime = obj.soFar ? null : dateToTimestamp(obj.expireTime)
   obj.expireTime = obj.soFar ? null : dateToTimestamp(obj.expireTime)
   obj && Object.keys(obj).length && Object.keys(obj).forEach(key => { if (['areaId', 'eduType', 'expType'].includes(key) && obj[key] === -1)  obj[key] = null })
   obj && Object.keys(obj).length && Object.keys(obj).forEach(key => { if (['areaId', 'eduType', 'expType'].includes(key) && obj[key] === -1)  obj[key] = null })
   return obj
   return obj

+ 2 - 0
components/positionItem/index.vue

@@ -93,6 +93,8 @@ const getSubmitParams = async() => {
   const baseInfo = await baseInfoRef.value.getQuery()
   const baseInfo = await baseInfoRef.value.getQuery()
   const requirement = await requirementRef.value.getQuery()
   const requirement = await requirementRef.value.getQuery()
   if (!baseInfo || !requirement) return
   if (!baseInfo || !requirement) return
+  // if (baseInfo.contentLength > 1500) uni.showToast({ title: '岗位职责字数超出限制', icon: 'none', duration: 2000 })
+  // if (baseInfo.requirementLength > 1500) uni.showToast({ title: '岗位要求字数超出限制', icon: 'none', duration: 2000 })
   
   
   submitParams = {
   submitParams = {
     ...baseInfo,
     ...baseInfo,