Commit 03739da2 authored by tanghao's avatar tanghao

添加清除特殊字符的处理

parent d4b3bc1a
......@@ -53,3 +53,15 @@ export const deleteExcelScripts = (ids: any) => {
export const testExcelScripts = (data: any) => {
return axios.post('/api/exlScript/testScript', data)
}
/**
* 清除特殊字符
* @param ids
* @returns
*/
export const clearSpecialCharacter = (title: any) => {
return axios.get('/api/exlScript/clearSpecialCharacters', {
params: { title },
headers: formHeader
})
}
\ No newline at end of file
......@@ -79,6 +79,10 @@ export function handleRangeTitle(range: any) {
* 横向 -> row 不变 纵向 -> column 不变
*
*/
console.log("isVertical = " ,isVertical)
console.log("rowLen = " ,rowLen)
console.log("columnLen = " ,columnLen)
for (let c = 0; c < (isVertical ? rowLen : columnLen); c++) {
const title = {
title: '',
......
......@@ -22,6 +22,7 @@
<vxe-toolbar>
<template #buttons>
<!-- <vxe-button @click="allAlign = 'left'">居左</vxe-button> -->
<el-button type="primary" @click="showClear = true">特殊符号处理</el-button>
<el-button type="primary" @click="showEdit = true">新增</el-button>
<el-button type="danger" @click="removeRows">删除</el-button>
<el-button type="info" @click="showHelp" >帮助</el-button>
......@@ -59,6 +60,41 @@
</vxe-pager>
</div>
<vxe-modal
resize
show-footer
show-confirm-button
show-cancel-button
show-maximize
v-model="showClear"
title="清除特殊符号"
height="400"
width="800">
<el-form-item label="待清除字符串" >
<el-input
type="textarea"
rows="2"
v-model="specialCharacter"
placeholder="待清除字符串"
></el-input>
</el-form-item>
<el-form-item label="清除后的字符串" prop="title">
{{newspecialCharacter }}
</el-form-item>
<template #footer>
<el-button type="primary" @click="clearSpecial" :loading="saveLoading">执行</el-button>
<el-button @click="showClear = false">取消</el-button>
</template>
</vxe-modal>
<vxe-modal
width="70%"
height="90%"
......@@ -99,7 +135,6 @@
<el-form-item label="订单/变量" v-if="visibleTest" prop="cellValue">
<JsonEditorValue v-model="jsonStr" :options="editorOptions" language="zh-CN"/>
<el-button class="mt-1" type="primary" size="small" @click="sendTest">执行</el-button>
</el-form-item>
</el-col>
......@@ -131,7 +166,9 @@ import {
addExcelScripts,
editExcelScripts,
deleteExcelScripts,
testExcelScripts
testExcelScripts,
clearSpecialCharacter
} from '@/api/scripts'
import { ElMessage, type FormInstance } from 'element-plus'
import type { VxeTableInstance } from 'vxe-table'
......@@ -143,6 +180,13 @@ const visibleTest = ref(false)
const loading = ref(false)
const saveLoading = ref(false)
const showEdit = ref(false)
const showClear = ref(false)
const specialCharacter = ref('')
const newspecialCharacter = ref('')
const formState = reactive({
title: '',
content: '',
......@@ -268,6 +312,25 @@ const onSubmit = async () => {
saveLoading.value = false
}
// 清除特殊字符
const clearSpecial = async () => {
saveLoading.value = true
try {
const { data } = await clearSpecialCharacter(specialCharacter.value)
newspecialCharacter.value = data.result
console.log(newspecialCharacter)
} catch {}
saveLoading.value = false
}
const onQuery = async () => {
loading.value = true
try {
......
......@@ -203,6 +203,7 @@ const setNickName = () => {
}
const position = getRangePosition()
if (!position) return
console.log(groupTitles)
// 清除颜色
if (groupTitles.value.length) {
groupTitles.value.forEach((item) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment