Browse Source

Merge branch 'lwx_13'

# Conflicts:
#	src/types/components.d.ts
lwx_14
超级管理员 1 year ago
parent
commit
e8c72fad6c
  1. 9154
      node_modules/element-plus/es/components/slider/src/composables/use-slide.d.ts
  2. 3
      src/api/DesignForm/types.ts
  3. 10
      src/components/DesignForm/assembly/index.ts
  4. 30
      src/components/DesignForm/formControlAttr.vue
  5. 29
      src/components/DesignForm/formControlPropertiNew.vue
  6. 4
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  7. 3
      src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue
  8. 49
      src/widget/associatedforms/associatedForms.vue
  9. 136
      src/widget/associatedforms/associatedFormsTinyace.vue
  10. 127
      src/widget/associatedforms/associatedFormsTinyaceRange.vue

9154
node_modules/element-plus/es/components/slider/src/composables/use-slide.d.ts

File diff suppressed because it is too large

3
src/api/DesignForm/types.ts

@ -103,7 +103,8 @@ export interface formData{
form: { form: {
size: any; size: any;
name:any, name:any,
formName:any formName:any,
dataTitle:any
}; };
config: any; config: any;
events?:any; events?:any;

10
src/components/DesignForm/assembly/index.ts

@ -753,9 +753,19 @@ export default [
modelValue: '', modelValue: '',
hideConditionHtml: '', hideConditionHtml: '',
hideConditionHtmlCopy: '', hideConditionHtmlCopy: '',
hideGongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
formid: '', formid: '',
dataRangeConditionHtml: '', dataRangeConditionHtml: '',
dataRangeConditionHtmlCopy: '', dataRangeConditionHtmlCopy: '',
dataRangeGongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
saveFlag: false, saveFlag: false,
asfasfLabel:'', asfasfLabel:'',
fillRoles: [ fillRoles: [

30
src/components/DesignForm/formControlAttr.vue

@ -2263,9 +2263,20 @@ function aftTextChanged(str:string){
controlData.value.control.hideConditionHtml = str controlData.value.control.hideConditionHtml = str
} }
function aftGongshiChanged(gongshi:any){
controlData.value.control.hideGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.hideGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.hideGongShi.mathsString = gongshi.mathsString
}
function aftTextChangedRange(str:string){ function aftTextChangedRange(str:string){
controlData.value.control.dataRangeConditionHtml = str controlData.value.control.dataRangeConditionHtml = str
} }
function aftGongshiChangedRange(gongshi:any){
controlData.value.control.dataRangeGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.dataRangeGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.dataRangeGongShi.mathsString = gongshi.mathsString
}
//asf //asf
function asfhTextCancel(){ function asfhTextCancel(){
determine.value = false determine.value = false
@ -3457,6 +3468,21 @@ const disabledIstrue = (val:string) => {
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon> <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item class="form_cont">
数据标题
<el-tree-select
v-model="formData.dataTitle"
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTree"
:render-after-expand="false"
style="width: 240px"
/>
</el-form-item>
<template v-if="!state.isSearch"> <template v-if="!state.isSearch">
<el-divider content-position="left">接口数据事件</el-divider> <el-divider content-position="left">接口数据事件</el-divider>
@ -3822,7 +3848,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain"> <el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div> <div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;"> <div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged"></AssociatedFormsTinyace> <AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged" @gongshi-change = "aftGongshiChanged"></AssociatedFormsTinyace>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;"> <!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数 <span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> --> </div> -->
@ -3932,7 +3958,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain"> <el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div> <div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;"> <div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange"></AssociatedFormsTinyaceRange> <AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange" @gongshi-change = "aftGongshiChangedRange"></AssociatedFormsTinyaceRange>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;"> <!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数 <span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> --> </div> -->

29
src/components/DesignForm/formControlPropertiNew.vue

@ -2305,9 +2305,20 @@ function aftTextChanged(str:string){
controlData.value.control.hideConditionHtml = str controlData.value.control.hideConditionHtml = str
} }
function aftGongshiChanged(gongshi:any){
controlData.value.control.hideGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.hideGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.hideGongShi.mathsString = gongshi.mathsString
}
function aftTextChangedRange(str:string){ function aftTextChangedRange(str:string){
controlData.value.control.dataRangeConditionHtml = str controlData.value.control.dataRangeConditionHtml = str
} }
function aftGongshiChangedRange(gongshi:any){
controlData.value.control.dataRangeGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.dataRangeGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.dataRangeGongShi.mathsString = gongshi.mathsString
}
//asf //asf
function asfhTextCancel(){ function asfhTextCancel(){
determine.value = false determine.value = false
@ -3507,6 +3518,20 @@ const disabledIstrue = (val:string) => {
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon> <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item class="form_cont">
数据标题
<el-tree-select
v-model="formData.dataTitle"
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTree"
:render-after-expand="false"
style="width: 240px"
/>
</el-form-item>
<template v-if="!state.isSearch"> <template v-if="!state.isSearch">
<el-divider content-position="left">接口数据事件</el-divider> <el-divider content-position="left">接口数据事件</el-divider>
@ -3872,7 +3897,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain"> <el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div> <div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;"> <div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged"></AssociatedFormsTinyace> <AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged" @gongshi-change = "aftGongshiChanged"></AssociatedFormsTinyace>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;"> <!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数 <span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> --> </div> -->
@ -3982,7 +4007,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain"> <el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div> <div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;"> <div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange"></AssociatedFormsTinyaceRange> <AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange" @gongshi-change = "aftGongshiChangedRange"></AssociatedFormsTinyaceRange>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;"> <!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数 <span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> --> </div> -->

4
src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue

@ -170,7 +170,7 @@ const gainAppFormPageInit = () =>{
if(stateData.tableData.columns.length>0){ if(stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){ for(let i = 0;i<stateData.tableData.columns.length;i++){
if(stateData.tableData.columns[i].config!=undefined && stateData.tableData.columns[i].control!=undefined){ if(stateData.tableData.columns[i].config!=undefined && stateData.tableData.columns[i].control!=undefined){
console.log(stateData.tableData.columns[i]) //console.log(stateData.tableData.columns[i])
let paramx:string = ""+stateData.tableData.columns[i].control.optionsValue3Field let paramx:string = ""+stateData.tableData.columns[i].control.optionsValue3Field
/* /*
在这里请求后台获取字段 在这里请求后台获取字段
@ -179,7 +179,7 @@ const gainAppFormPageInit = () =>{
stateData.tableData.columns[i].options = data stateData.tableData.columns[i].options = data
if(stateData.searchData.length>0){ if(stateData.searchData.length>0){
for(let j = 0;j<stateData.searchData.length;j++){ for(let j = 0;j<stateData.searchData.length;j++){
console.log(stateData.searchData[j]) //console.log(stateData.searchData[j])
if(stateData.searchData[j].id==stateData.tableData.columns[i].id){ if(stateData.searchData[j].id==stateData.tableData.columns[i].id){
stateData.searchData[j].options = data stateData.searchData[j].options = data
} }

3
src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue

@ -73,7 +73,8 @@ const state = reactive<formStruct>({
form: { form: {
size: 'default', size: 'default',
name:'', name:'',
formName: formConfigCont.formName formName: formConfigCont.formName,
dataTitle: []
}, },
config: { config: {
groupKey:props.groupKey groupKey:props.groupKey

49
src/widget/associatedforms/associatedForms.vue

@ -1,15 +1,52 @@
<template> <template>
<el-input v-model="input" style="width: 240px" placeholder="" /> <!-- <el-input v-model="input" style="width: 240px" placeholder="" /> -->
<el-select v-model="value1" placeholder="请选择" style="width: 240px">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template> </template>
<script setup > <script setup>
const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
data: {
type: Object,
}
})
const value1 = ref('')
const options = [
{
value: 'Option1',
label: 'Option1',
},
{
value: 'Option2',
label: 'Option2',
},
{
value: 'Option3',
label: 'Option3',
},
{
value: 'Option4',
label: 'Option4',
},
{
value: 'Option5',
label: 'Option5',
},
]
onMounted(()=>{
console.log(props.data.control.hideConditionHtml)
console.log(props.data.control.dataRangeConditionHtml)
})
</script> </script>
<style> <style></style>
</style>

136
src/widget/associatedforms/associatedFormsTinyace.vue

@ -6,6 +6,7 @@ import "tinymce/models/dom"; // 特别注意 tinymce 6.0.0 版本之后必须引
import "tinymce/themes/silver/theme"; import "tinymce/themes/silver/theme";
import Editor from "@tinymce/tinymce-vue"; // import Editor from "@tinymce/tinymce-vue"; //
import { v4 as uuidv4 } from "uuid"; import { v4 as uuidv4 } from "uuid";
import { ElMessage } from 'element-plus'
let onlyNumber = uuidv4().replaceAll('-','').toString(); // let onlyNumber = uuidv4().replaceAll('-','').toString(); //
@ -42,21 +43,135 @@ const props = defineProps({
}, },
}) })
let $emit = defineEmits(["textChange"]); let $emit = defineEmits(["textChange","gongshiChange"]);
const tinymceHtml = ref("") const tinymceHtml = ref("")
tinymceHtml.value = props.aftText tinymceHtml.value = props.aftText
const tinymceBox = ref(null)
onMounted(() => { onMounted(() => {
tinymce.init({}); // tinymce.init({}); //
}); });
watch(()=>tinymceHtml.value, (val:any) => { watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val); $emit('textChange',val);
}, nextTick(()=>{
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
element.childNodes.forEach(child => {
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
formulaTwo.push(child.dataset.keyid)
}else{
formulaTwo.push(child.innerText?child.innerText:child.data)
}
})
});
let suanShitwo = formulaTwo.join('').replace(/\s+/g, "");
let gongShi ={
formulaHtml:tinymceBox.value.innerHTML,
mathsString:tinymceBox.value.innerText,
mathsFormula:suanShitwo,
}
$emit('gongshiChange',gongShi);
if(containsNewline(gongShi.mathsString)){
errorCondition("条件不允许换行")
}else if(!gongShi.formulaHtml.startsWith("<p><span")){
errorCondition("条件需以蓝色块开头")
}else if(gongShi.formulaHtml.endsWith("</span></p>")){
errorCondition("条件不能以蓝色块结尾")
}else if(countSpanTags(gongShi.formulaHtml)>1){
errorCondition("不允许出现多个蓝色块")
}else if(!containsSingleComparator(gongShi.mathsFormula)){
errorCondition("不存在有效符号")
}else if(checkEnding(gongShi.mathsFormula)){
errorCondition("不能以符号为结尾")
}else{
succCondition()
}
})
},
{ deep: true } { deep: true }
) )
function checkEnding(str: string) {
const symbols = ['==', '>=', '>', '<=', '<', '!=', '='];
const trimmedStr = str.trim();
for (let symbol of symbols) {
if (trimmedStr.endsWith(symbol)) {
return true;
}
}
return false;
}
function containsSingleComparator(str: string) {
//
const comparators = ['==', '>=', '>', '<=', '<', '!='];
let found = false; //
let i = 0; //
while (i < str.length - 1) { //
//
for (const comparator of comparators) {
if (str.substr(i, comparator.length) === comparator) {
//
if (found) {
// false
return false;
}
found = true; //
//
i += comparator.length - 1;
break; //
}
}
i++; //
}
//
return found;
}
function containsComparator(str: string) {
if(str.includes("==")||str.includes("!=")||str.includes(">")||str.includes(">=")||str.includes("<")||str.includes("<=")){
return true
}else{
return false
}
}
const containsNewline = (str: string) => {
//console.log("Testing string:", str); //
return /\n/.test(str);
};
const countSpanTags = (str: string) => {
// 使<span>
const matches = str.match(/<span\b[^>]*>/gi);
// matchesnull0
//
return matches ? matches.length : 0;
};
function succCondition(){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式校验通过',
type: 'success',
duration:3500,
})
}
function errorCondition(str:string){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式错误 : '+str+' , 正确条件格式如 : 年龄==10',
type: 'error',
duration:3500,
})
}
const addIcon = (currentObject:any) =>{ const addIcon = (currentObject:any) =>{
@ -83,6 +198,7 @@ const focusEditor = ()=>{
} }
defineExpose({ defineExpose({
tinymceHtml, tinymceHtml,
addIcon, addIcon,
@ -96,12 +212,20 @@ defineExpose({
</script> </script>
<template > <template >
<div > <div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor> <editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit" ></editor>
</div> </div>
<div class="isHidde">
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
</div>
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>
.isHidde{
display:none;
position: fixed;
z-index: 1;
margin-top: -10px
}
</style> </style>

127
src/widget/associatedforms/associatedFormsTinyaceRange.vue

@ -42,11 +42,11 @@ const props = defineProps({
}, },
}) })
let $emit = defineEmits(["textChange"]); let $emit = defineEmits(["textChange","gongshiChange"]);
const tinymceHtml = ref("") const tinymceHtml = ref("")
tinymceHtml.value = props.aftText tinymceHtml.value = props.aftText
const tinymceBox = ref(null)
onMounted(() => { onMounted(() => {
@ -54,9 +54,122 @@ onMounted(() => {
}); });
watch(()=>tinymceHtml.value, (val:any) => { watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val); $emit('textChange',val);
nextTick(()=>{
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
element.childNodes.forEach(child => {
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
formulaTwo.push(child.dataset.keyid)
}else{
formulaTwo.push(child.innerText?child.innerText:child.data)
}
})
});
let suanShitwo = formulaTwo.join('').replace(/\s+/g, "");
let gongShi ={
formulaHtml:tinymceBox.value.innerHTML,
mathsString:tinymceBox.value.innerText,
mathsFormula:suanShitwo,
}
$emit('gongshiChange',gongShi);
if(containsNewline(gongShi.mathsString)){
errorCondition("条件不允许换行")
}else if(!gongShi.formulaHtml.startsWith("<p><span")){
errorCondition("条件需以蓝色块开头")
}else if(gongShi.formulaHtml.endsWith("</span></p>")){
errorCondition("条件不能以蓝色块结尾")
}else if(countSpanTags(gongShi.formulaHtml)>1){
errorCondition("不允许出现多个蓝色块")
}else if(!containsSingleComparator(gongShi.mathsFormula)){
errorCondition("不存在有效符号")
}else if(checkEnding(gongShi.mathsFormula)){
errorCondition("不能以符号为结尾")
}else{
succCondition()
}
})
}, },
{ deep: true } { deep: true }
) )
function containsSingleComparator(str: string) {
//
const comparators = ['==', '>=', '>', '<=', '<', '!='];
let found = false; //
let i = 0; //
while (i < str.length - 1) { //
//
for (const comparator of comparators) {
if (str.substr(i, comparator.length) === comparator) {
//
if (found) {
// false
return false;
}
found = true; //
//
i += comparator.length - 1;
break; //
}
}
i++; //
}
//
return found;
}
function checkEnding(str: string) {
const symbols = ['==', '>=', '>', '<=', '<', '!=', '='];
const trimmedStr = str.trim();
for (let symbol of symbols) {
if (trimmedStr.endsWith(symbol)) {
return true;
}
}
return false;
}
function containsComparator(str: string) {
if(str.includes("==")||str.includes("!=")||str.includes(">")||str.includes(">=")||str.includes("<")||str.includes("<=")){
return true
}else{
return false
}
}
const containsNewline = (str: string) => {
//console.log("Testing string:", str); //
return /\n/.test(str);
};
const countSpanTags = (str: string) => {
// 使<span>
const matches = str.match(/<span\b[^>]*>/gi);
// matchesnull0
//
return matches ? matches.length : 0;
};
function errorCondition(str:string){
ElMessage.closeAll()
ElMessage({
showClose: true,
//message: ' : '+str+' , : ==10',
message: str,
type: 'error',
duration:3500,
})
}
function succCondition(){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式校验通过',
type: 'success',
duration:3500,
})
}
const addIcon = (currentObject:any) =>{ const addIcon = (currentObject:any) =>{
@ -99,10 +212,18 @@ defineExpose({
<div > <div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor> <editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor>
</div> </div>
<div class="isHidde">
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
</div>
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>
.isHidde{
display:none;
position: fixed;
z-index: 1;
margin-top: -10px
}
</style> </style>

Loading…
Cancel
Save