Browse Source

计算公式前端页面

v4
超级管理员 2 years ago
parent
commit
08b9f6ee51
  1. 2
      public/skins/ui/oxide-dark/skin.css
  2. 2
      public/skins/ui/oxide/skin.css
  3. 2
      public/tinymce/skins/ui/oxide-dark/skin.css
  4. 2
      public/tinymce/skins/ui/oxide/skin.css
  5. 2
      public/tinymce/skins/ui/oxide/skin.min.css
  6. 12
      src/components/DesignForm/assembly/index.ts
  7. 131
      src/components/DesignForm/formControlAttr.vue
  8. 89
      src/components/DesignForm/math/matchFunction.ts
  9. 509
      src/components/DesignForm/math/mathFormula.vue
  10. 62
      src/components/DesignForm/math/unitcss.ts
  11. 4
      src/permission.ts
  12. 10
      src/store/modules/user.ts
  13. 2
      src/views/login/index.vue
  14. 12
      src/views/sysworkflow/codepage/conf.js
  15. 3
      src/views/sysworkflow/codepage/createform.vue
  16. 219
      src/views/sysworkflow/codepage/page.vue
  17. 9
      src/widget/baidumap/index.vue
  18. 163
      src/widget/digitpage/index.vue
  19. 11
      src/widget/number/index.vue
  20. 8
      src/widget/org/index.vue
  21. 8
      src/widget/orgcitys/index.vue
  22. 8
      src/widget/urllink/index.vue

2
public/skins/ui/oxide-dark/skin.css

@ -57,7 +57,7 @@
}
.tox-tinymce {
border: 2px solid #161f29;
border-radius: 10px;
border-radius: 0px;
box-shadow: none;
box-sizing: border-box;
display: flex;

2
public/skins/ui/oxide/skin.css

@ -57,7 +57,7 @@
}
.tox-tinymce {
border: 2px solid #eeeeee;
border-radius: 10px;
border-radius: 0px;
box-shadow: none;
box-sizing: border-box;
display: flex;

2
public/tinymce/skins/ui/oxide-dark/skin.css

@ -57,7 +57,7 @@
}
.tox-tinymce {
border: 2px solid #161f29;
border-radius: 10px;
border-radius: 0px;
box-shadow: none;
box-sizing: border-box;
display: flex;

2
public/tinymce/skins/ui/oxide/skin.css

@ -57,7 +57,7 @@
}
.tox-tinymce {
border: 2px solid #eeeeee;
border-radius: 10px;
border-radius: 0px;
box-shadow: none;
box-sizing: border-box;
display: flex;

2
public/tinymce/skins/ui/oxide/skin.min.css

File diff suppressed because one or more lines are too long

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

@ -37,9 +37,17 @@ const selectOption: any = [
iconFont: 'fa-money',
control: {
// 组件所有属性
modelValue: ''
modelValue: '',
mathFormula:{
formulaHtml:'',
mathsString:'',
mathsFormula:'',
takingMethod:1,
digit:2
}
},
config: {} // 其他配置信息
config: {}, // 其他配置信息
selectvalue: "default"
},
{
type: 'textarea',

131
src/components/DesignForm/formControlAttr.vue

@ -14,9 +14,13 @@ import { PublicAtrr } from '@/api/DesignForm/types'
import { chineseToPinyin } from '@/api/DesignForm/requestapi'
//
import MathFormula from '@/components/DesignForm/math/mathFormula.vue'
const props = withDefaults( //
defineProps<{
formData: any
formList: any
formConfig: any
formOtherData: any
customerformid: number | string,
@ -31,6 +35,7 @@ const props = withDefaults( //接收父级参数
}
}
)
const mathBoxShow = ref(false)
//
const emits = defineEmits<{
(e: 'openDialog', data: any): void
@ -41,6 +46,8 @@ const emits = defineEmits<{
const { formConfig, formData } = toRefs(props)
const store = useDesignFormStore() as any
const controlData = computed(() => {
// console.log("----------------->",store)
// console.log("--------1--------->",store.controlAttr)
return store.controlAttr
})
const dataSourceOption = ref([])
@ -167,6 +174,7 @@ const formAttr = computed(() => {
]
})
const attrList = computed(() => {
// console.log("controlData.value-1-->",controlData.value)
if (Object.keys(controlData.value).length) {
const {
control = {},
@ -174,8 +182,12 @@ const attrList = computed(() => {
name,
config = {},
item = {},
attr = {}
}: { control: any;type:any;name:any;item:any;attr:any; config: any } = controlData.value
attr = {},
selectvalue = "default",
mathFormula = {}
}: { control: any;type:any;name:any;item:any;attr:any; config: any,selectvalue:any,mathFormula:any } = controlData.value
// console.log("controlData.value--->",controlData.value)
// console.log("controlData.value-1-->",control,selectvalue)
let columnIndex = false //
if (type === 'table') {
//
@ -742,6 +754,17 @@ const attrList = computed(() => {
type: 'select',
dict: { default: 'default', simple: 'simple' },
vShow: ['tinymce']
},
{
label: '默认值',
value: control.mathsValue,
selectvalue: selectvalue,
path: 'control.mathsValue',
placeholder: '显示风格(预览查看效果)',
type: 'digitpage',
dict: { default: '自定义', simple: '编辑公式' },
vShow: ['digitpage'],
control:control
}
])
//
@ -775,7 +798,12 @@ watch(
)
const fileSignAry = reactive<any>([])
const controlChange = (obj: any, val: any) => {
console.log("字段编辑----》",obj,val,controlData.value)
// console.log("--1--",obj)
// console.log("--2--",obj.eventName)
// console.log("--3--",val)
// console.log("--4--",controlData.value)
// console.log("--5--",obj.path)
// select
switch (obj.eventName) {
case 'selectMultiple':
@ -791,7 +819,7 @@ const controlChange = (obj: any, val: any) => {
tableColumnAdd(val)
break
case 'formatNumber':
// val = parseInt(val) //
val = parseInt(val) //
break
case 'filedNameKey':
//
@ -858,7 +886,7 @@ const controlChange = (obj: any, val: any) => {
})
}
console.log("字段编辑--fileSignAry--》",fileSignAry)
// console.log("--fileSignAry--",fileSignAry)
break
}
if (obj.path) {
@ -1124,7 +1152,7 @@ const editFormDict = (tooltip: string) => {
}
})
.catch(res => {
console.log(res)
// console.log(res)
})
}
}
@ -1178,7 +1206,7 @@ const rulesSelectChange = (item: any, val: string) => {
}
}
const rulesSelectNumChange = (item: any, val: string) => {
console.log("快速添加校验规则改变时",item,val)
// console.log("",item,val)
const filter = state.numberRulesList.filter(item => item.type === val)
if (filter && filter.length) {
item.message = filter[0].msg
@ -1206,6 +1234,56 @@ const isNotWrite = (val:any) =>{
}
return false
}
const unitInfo = ref<any>()
const formListmap = ref<any>()
const subUnit = ref<any>()
//
const digitPageSub = (val:any,envt:any) => {
// console.log("--->",val.value,envt,props.formData)
// console.log("-1-->",props.formList)
// console.log("-2-->",props.formConfig)
// console.log("--3->",props.formOtherData)
// console.log("--4->",props.customerformid)
// console.log("--5->",controlData.value)
// console.log("-6-->",val)
subUnit.value = val
controlData.value.selectvalue = envt
formListmap.value = props.formList
if(envt == "simple"){
unitInfo.value = attrList.value
mathBoxShow.value = true
}
}
const openMathDialog = (val:any) => {
subUnit.value = val
formListmap.value = props.formList
unitInfo.value = attrList.value
mathBoxShow.value = true
}
//
const updataDigit = (key:sring,val:any) => {
// console.log("-1-->",props.formList)
// console.log("-2-->",props.formConfig)
// console.log("--3->",props.formOtherData)
// console.log("--4->",formAttr)
formConfig.value[key] = val.mathsFormula
// console.log("--->",key,val)
attrList.value.forEach((item:any)=>{
// console.log("--1->",item)
if(item.type == "digitpage"){
item.control.mathFormula = {
formulaHtml:val.formulaHtml,
mathsString:val.mathsString,
mathsFormula:val.mathsFormula,
takingMethod:val.takingMethod,
digit:val.digit
}
}
})
// console.log("-5-->",props.formConfig)
}
</script>
<template>
<div class="sidebar-tools">
@ -1214,7 +1292,6 @@ const isNotWrite = (val:any) =>{
<el-form size="small" class="form">
<div class=""><h3>通用属性</h3></div>
<template v-for="(item, index) in attrList" :key="index">
{{ item.inputStyle }}
<el-form-item :label="item.label">
<el-select
v-if="item.type === 'select'"
@ -1239,6 +1316,39 @@ const isNotWrite = (val:any) =>{
v-model="item.value"
@change="controlChange(item, $event)"
/>
<template v-else-if="item.type === 'digitpage'">
<el-row>
<el-col :span="12">
<el-select
v-model="item.selectvalue"
:placeholder="item.placeholder"
:filterable="item.path === 'name'"
:allow-create="item.path === 'name'"
:clearable="item.clearable"
@change="digitPageSub(item, $event)"
>
<el-option
v-for="(opt, key) in item.dict"
:key="key"
:value="item.path === 'name' ? opt.name : key"
:label="
item.path === 'name' ? `${opt.label}(${opt.name})` : opt
"
/>
</el-select>
</el-col>
<el-col :span="12">
<el-input-number
v-if="item.selectvalue == 'default'"
v-model="item.value"
class="mx-4"
/>
</el-col>
</el-row>
<div v-if="item.selectvalue == 'simple'" style="width:100%;cursor: pointer; margin-top:10px;" @click="openMathDialog(item)" v-html="item.control.mathFormula.formulaHtml"></div>
<MathFormula v-model:show="mathBoxShow" :sub-unit="subUnit" :unit-info="attrList" :form-listmap="formListmap" @updata-digit="updataDigit" />
</template>
<el-input
v-else
:type="item.inputStyle"
@ -1246,6 +1356,8 @@ const isNotWrite = (val:any) =>{
:placeholder="item.placeholder"
@input="controlChange(item, $event)"
/>
</el-form-item>
</template>
<template v-if="controlData.config">
@ -1725,6 +1837,9 @@ const isNotWrite = (val:any) =>{
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style lang='scss' scoped>

89
src/components/DesignForm/math/matchFunction.ts

@ -0,0 +1,89 @@
export const funcList = [
{
id: "1",
name: "函数列表",
children: [
{
id: "11",
name: "SUM",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SUM(1,2)=3</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SUM(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SUM(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "14",
name: "AVG",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> AVG(1,2)=1.5</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">AVG(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SUM(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "12",
name: "MIN",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A, padding: 5px 0 ;"> SUM(1,2)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MIN(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
</ul>
`,
},
{
id: "13",
name: "MAX",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SUM(1,2)=2</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MAX(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
</ul>
`,
},
],
},
]
export interface fieldList{
id: string,
name: string,
children?:fieldChildren[]
}
export interface fieldChildren{
id: string,
type:string,
name: string,
dataType: string,
dataTypeName: string,
}

509
src/components/DesignForm/math/mathFormula.vue

@ -0,0 +1,509 @@
<!--
@ 作者: 秦东
@ 时间: 2023-12-29 16:27:26
@ 备注: 数学公式
-->
<script lang='ts' setup>
import { ref, onMounted } from "vue";
import typeColors from "./unitcss";
import { funcList,fieldList,fieldChildren } from "./matchFunction"
/**
* 富文本组件
*/
import tinymce from "tinymce/tinymce";
import "tinymce/models/dom"; // tinymce 6.0.0
import "tinymce/themes/silver/theme";
import Editor from "@tinymce/tinymce-vue"; //
/**
* 初始富文本组件
*/
const tinymceInit = {
language_url: "/tinymce/langs/zh-Hans.js", // public
language: "zh-Hans", // zh-Hans.js
skin_url: "/tinymce/skins/ui/oxide", //
height: 260, //
statusbar:false,
toolbar:false,
branding: false, //Powered by TinyMCE
menubar: false, //
forced_root_block:'',
newline_behavior:"",
content_css: "/tinymce/skins/content/default/content.css", //csscsscss
}
const props = defineProps({
show:{
type:Boolean,
default:false
},
subUnit:{
type:Object,
default(){
return {}
}
},
unitInfo:{
type:Object,
default(){
return {}
}
},
formListmap:{
type:Object,
default(){
return {}
}
},
});
const tinymceHtml = ref("")
const emits = defineEmits(["update:show","updataDigit"]);
const is_Show = computed({
get: () => props.show,
set: (val) => {
emits("update:show", val);
},
});
const valueType = ref<number>(1)
const digit = ref<number>(2)
//
const options = [
{
label:"四舍五入",
value:1
},
{
label:"向上取整",
value:2
},
{
label:"向下取整",
value:3
},
{
label:"舍去取整",
value:4
}
]
const descContent = ref<any>()
const funcCurCollapse = ref("1")
const itemMouseenter = (item) => {
descContent.value = item.desc;
};
const itemMouseleave = () => {
descContent.value = "";
};
//
const addTag = (data:any,type:string) => {
let viewStyle = type == "field" ? typeColors.find((x) => x.name == data.dataType)?.viewStyle : typeColors.find((x) => x.name == "func")?.viewStyle;
let viewStyleStr = "margin:0 5px;";
Object.keys(viewStyle).map((key) => {
let keyStr = key.replace(/([A-Z])/g, "-$1").toLowerCase();
viewStyleStr += `${keyStr}:${viewStyle[key]};`;
});
if (type == "field") {
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span style="${viewStyleStr}" contenteditable="false" data-keyid="${data.id}">${data.name}</span>`);
}else{
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span class="hanshu" style="${viewStyleStr}" contenteditable="false">${data.name}</span><span class="exp" style="${viewStyleStr}" contenteditable="false">(</span><span class="exp" style="${viewStyleStr}" contenteditable="false">)</span>`);
}
}
/**
* 计算器
*/
const computeNumber = (val:string) =>{
if(val === "C"){
tinymceHtml.value = "";
}else{
tinymce.activeEditor.execCommand('mceInsertContent', false, val);
}
}
//
const fieldList = reactive<fieldList[]>()
const formFieldKey = ref("1")
const muBiaoZiDuan = ref<string>("目标字段")
const fileKey = ref<string>("")
const fieldCont = ref<fieldList[]>()
const unitListAry = ref<fieldChildren[]>()
watch(()=>props.show,(val:boolean) => {
// console.log("--->",props.subUnit)
valueType.value = props.subUnit.control.mathFormula.takingMethod
digit.value = props.subUnit.control.mathFormula.digit
tinymceHtml.value = props.subUnit.control.mathFormula.formulaHtml
// {
// "modelValue": "",
// "mathFormula": {
// "formulaHtml": "<p><span class=\"hanshu\" style=\"margin: 0 5px; color: #871ab3; padding: 3px 5px;\" contenteditable=\"false\">SUM</span><span class=\"exp\" style=\"margin: 0 5px; color: #871ab3; padding: 3px 5px;\" contenteditable=\"false\">(</span><span style=\"margin: 0 5px; background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px;\" contenteditable=\"false\" data-keyid=\"digitpage1704175153669\"></span>,<span style=\"margin: 0 5px; background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px;\" contenteditable=\"false\" data-keyid=\"digitpage1704175154851\"></span>,<span style=\"margin: 0 5px; background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px;\" contenteditable=\"false\" data-keyid=\"digitpage1704175156234\"></span><span class=\"exp\" style=\"margin: 0 5px; color: #871ab3; padding: 3px 5px;\" contenteditable=\"false\">)</span></p>",
// "mathsString": "SUM(,,)",
// "mathsFormula": "SUM(digitpage1704175153669,digitpage1704175154851,digitpage1704175156234)"
// }
// }
if(val){
props.unitInfo.forEach((item:any)=>{
if(item.label == "label值" ){
muBiaoZiDuan.value = item.value
}
if(item.label == "字段标识" ){
fileKey.value = item.value
}
})
let zuJian = []
if(props.formListmap && props.formListmap.length > 0){
props.formListmap.forEach((items:any)=>{
// console.log("--->",items)
if(items.type == "digitpage"){
zuJian.push({
id: items.name,
type:"field",
name: items.item.label,
dataType: "number",
dataTypeName: "数字",
})
}
})
}
let zuJianMaxt = []
unitListAry.value = zuJian
zuJianMaxt.push({
id: "1",
name: "表格字段",
children:unitListAry
})
fieldCont.value = zuJianMaxt
}
})
const tinymceBox = ref(null)
//
const handleClose = () => {
emits("update:show", false);
tinymceBox.value = ""
tinymceHtml.value = ""
}
//
const sendDigitFunc = () => {
let pattern = "(<p>)(.*)(<\/p>)";
// let kjkdls = a(tinymceBox.value.innerHTML).find("p");
// console.log("kjkdls------------------->",kjkdls)
// console.log("tinymceBox----->",tinymceBox);
// console.log("tinymceBox--1--->",tinymceBox.value.innerHTML);
// console.log("tinymceBox--2--->",tinymceBox.value.innerText);
// console.log("tinymceBox--3--->",tinymceBox.value);
let fsdf = tinymceBox.value.innerHTML.match(pattern);
// console.log("tinymceBox--4--->",fsdf,fsdf[2]);
// console.log("tinymceBox--5--->",tinymceBox.value.childNodes);
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
// console.log("element----->",element.childNodes);
element.childNodes.forEach(child => {
// console.log("child--classList--->",child.classList);
// console.log("child----->",child.innerText,child.data);
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
// console.log("child.dataset--222222--->",child.dataset.keyid);
formulaTwo.push(child.dataset.keyid)
}else{
formulaTwo.push(child.innerText?child.innerText:child.data)
}
// if(child.classList){
// formulaTwo.push(child.innerHTML)
// if(child.classList.value == "hanshu" || child.classList.value == "exp"){
// formulaOne.push(child.innerHTML)
// }
// if(child.dataset && child.dataset.key){
// formulaTwo.push(child.dataset.keyid)
// }
// }else{
// formulaOne.push(child.data)
// formulaTwo.push(child.data)
// }
})
});
// console.log("formulaOne------>",formulaOne);
// console.log("formulaTwo",formulaTwo);
let suanShioen = formulaOne.join('').replace(/\s+/g, "");
let suanShitwo = formulaTwo.join('').replace(/\s+/g, "");
// console.log("suanShioen",suanShioen);
// console.log("suanShitwo",suanShitwo);
let gongShi ={
formulaHtml:tinymceBox.value.innerHTML,
mathsString:tinymceBox.value.innerText,
mathsFormula:suanShitwo,
takingMethod:valueType.value,
digit:digit.value
}
emits("updataDigit",fileKey.value, gongShi);
handleClose();
}
//
const sswrval = () => {
if(valueType.value == 1){
digit.value = digit.value==0 ? 2 : digit.value;
}else{
digit.value = 0
}
}
onMounted(() => {
tinymce.init({}); //
});
</script>
<template>
<el-dialog
v-model="is_Show"
title="公式编辑"
width="800px"
:before-close="handleClose"
>
<el-row>
<el-col :span="10">
<el-text>{{ muBiaoZiDuan }} = </el-text>
</el-col>
<el-col :span="14" style="text-align:right;">
<el-select v-model="valueType" class="m-2 kuandu" placeholder="Select" @change="sswrval">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-text v-if="valueType==1">保留</el-text>
<el-input-number
v-if="valueType==1"
v-model="digit"
class="mx-4 kuandu"
:min="0"
:max="10"
controls-position="right"
/>
<el-text>位小数</el-text>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="16">
<editor id="tinymce" ref="hjks" v-model="tinymceHtml" :init="tinymceInit" ></editor>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('(')">(</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber(')')">)</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('C')">C</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('+')">+</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('1')">1</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('2')">2</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('3')">3</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('-')">-</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('4')">4</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('5')">5</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('6')">6</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('*')">×</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('7')">7</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('8')">8</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('9')">9</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('/')">÷</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('%')">%</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('0')">0</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('.')">.</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('=')">=</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="bian_kuang colBoxContent">
<el-collapse v-model="formFieldKey">
<el-collapse-item v-for="(group,group_idx) in fieldCont" :key="group_idx" :title="group.name" :name="group.id">
<div v-for="(i,idx) in group.children" :key="idx" class="item" @mouseenter="itemMouseenter(i)" @mouseleave="itemMouseleave" @click="addTag(i,'field')">
<div class="name">{{i.name}}</div>
<div class="type" :style="typeColors.find(x=>x.name==i.dataType)?.typeStyle">
{{i.dataTypeName}}
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</el-col>
<el-col :span="6">
<div class="bian_kuang colBoxContent">
<el-collapse v-model="funcCurCollapse">
<el-collapse-item v-for="(group,group_idx) in funcList" :key="group_idx" :title="group.name" :name="group.id">
<div v-for="(i,idx) in group.children" :key="idx" class="item" @mouseenter="itemMouseenter(i)" @mouseleave="itemMouseleave" @click="addTag(i,'func')">
<div class="name">{{i.name}}</div>
<div class="type" :style="typeColors.find(x=>x.name==i.dataType)?.typeStyle">
{{i.dataTypeName}}
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</el-col>
<el-col :span="12">
<div class="bian_kuang mathMsg">
<div v-html="descContent" />
</div>
</el-col>
</el-row>
<div class="isHidde">
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="sendDigitFunc">确定</el-button>
</span>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
.butkey{
width:45px;
height:40px;
margin-bottom:15px;
}
.kuandu{
width:110px;
}
.bian_kuang{
border:1px solid #ebeef5;
height:300px;
width:100%;
overflow:hidden;
overflow-y: auto;
}
.isHidde{
display:none;
position: fixed;
z-index: 1;
margin-top: -10px
}
.colBoxContent{
width:100%;
height:300px;
overflow: hidden;
overflow-y: auto;
.item {
display: flex;
align-items: center;
margin: 8px 0;
padding: 0 8px;
cursor: pointer;
.name {
color: #000;
font-weight: 700;
}
.type {
min-width: 50px;
padding: 1px 5px;
border-radius: 5px;
color: #fff;
margin-left: auto;
font-weight: 700;
text-align: center;
}
}
}
.mathMsg{
text-align: left;
padding:5px 5px;
ul {
list-style-type: circle;
li{
cursor: pointer;
.info {
font-weight: 700;
color: #4a538a;
}
.example {
font-weight: 700;
.func {
color: #871ab3;
}
.param {
background: #1e87b6;
color: #fff;
padding: 3px 5px;
border-radius: 3px;
margin: 0px 5px;
}
}
}
}
}
</style>
<style>
.el-dialog__body {
margin-top: 0% !important;
padding-top: 0% !important;
}
</style>

62
src/components/DesignForm/math/unitcss.ts

@ -0,0 +1,62 @@
const typeColors = [
{
name: "string",
typeStyle: { background: "#3e5ca0", color: "#fff" },
viewStyle: {
background: "#1e87b6",
color: "#fff",
padding: "3px 5px",
borderRadius: "3px",
},
},
{
name: "date",
typeStyle: { background: "#3e5ca0", color: "#fff" },
viewStyle: {
background: "#1e87b6",
color: "#fff",
padding: "3px 5px",
borderRadius: "3px",
},
},
{
name: "dateTime",
typeStyle: { background: "#3e5ca0", color: "#fff" },
viewStyle: {
background: "#1e87b6",
color: "#fff",
padding: "3px 5px",
borderRadius: "3px",
},
},
{
name: "boolean",
typeStyle: { background: "#3e5ca0", color: "#fff" },
viewStyle: {
background: "#1e87b6",
color: "#fff",
padding: "3px 5px",
borderRadius: "3px",
},
},
{
name: "number",
typeStyle: { background: "#ff7519", color: "#fff" },
viewStyle: {
background: "#1e87b6",
color: "#fff",
padding: "3px 5px",
borderRadius: "3px",
},
},
{
name: "func",
typeStyle: { background: "#3e5ca0", color: "#fff" },
viewStyle: {
color: "#871ab3",
padding: "3px 5px",
},
},
];
export default typeColors;

4
src/permission.ts

@ -14,7 +14,7 @@ const permissionStore = usePermissionStoreHook();
// 白名单路由
const whiteList = ["/login","/login/silentlogin"];
router.beforeEach(async (to, from, next) => {
router.beforeEach(async (to:any, from:any, next:any) => {
NProgress.start();
const hasToken = localStorage.getItem(appTokenKey);
@ -45,7 +45,7 @@ router.beforeEach(async (to, from, next) => {
const { perms } = await userStore.getInfo();
const accessRoutes = await permissionStore.generateRoutes(perms);
// console.log("路由权限--perms--》",accessRoutes);
accessRoutes.forEach((route) => {
accessRoutes.forEach((route:any) => {
router.addRoute(route);
});
next({ ...to, replace: true });

10
src/store/modules/user.ts

@ -34,7 +34,7 @@ export const useUserStore = defineStore("user", () => {
console.log("登陆使用12222",loginData);
return new Promise<void>((resolve, reject) => {
loginApiIng(loginData)
.then((response) => {
.then((response:any) => {
console.log("登陆使用",response);
const { tokenType, accessToken, key, token,userinfo } = response.data;
tokenIng.value = key + "_" + token; // Bearer eyJhbGciOiJIUzI1NiJ9.xxx.xxx
@ -43,7 +43,7 @@ export const useUserStore = defineStore("user", () => {
// userInfoCont.value = userinfo
resolve();
})
.catch((error) => {
.catch((error:any) => {
reject(error);
});
});
@ -64,7 +64,7 @@ export const useUserStore = defineStore("user", () => {
resolve();
return response.code
})
.catch((error) => {
.catch((error:any) => {
reject(error);
});
});
@ -107,7 +107,7 @@ export const useUserStore = defineStore("user", () => {
userInfoCont.value = data
resolve(data);
})
.catch((error) => {
.catch((error:any) => {
reject(error);
});
});
@ -123,7 +123,7 @@ export const useUserStore = defineStore("user", () => {
location.reload(); // 清空路由
resolve();
})
.catch((error) => {
.catch((error:any) => {
reject(error);
});
});

2
src/views/login/index.vue

@ -108,7 +108,7 @@ const route = useRoute();
/**
* 按钮loading
*/
const loading = ref(true);
const loading = ref(false);
/**
* 是否大写锁定
*/

12
src/views/sysworkflow/codepage/conf.js

@ -5,35 +5,35 @@ export default {
name: "系统参数",
children: [
{
id: "11",
id: "g11",
type:'field',
name: "岗位姓名",
dataType: "string",
dataTypeName: "字符串",
},
{
id: "12",
id: "k12",
type:'field',
name: "开始日期",
dataType: "date",
dataTypeName: "日期",
},
{
id: "13",
id: "j13",
type:'field',
name: "结束日期",
dataType: "date",
dataTypeName: "日期",
},
{
id: "14",
id: "z14",
type:'field',
name: "状态",
dataType: "boolean",
dataTypeName: "布尔",
},
{
id: "15",
id: "x15",
type:'field',
name: "序号",
dataType: "number",
@ -46,7 +46,7 @@ export default {
name: "入参",
children: [
{
id: "21",
id: "w21",
type:'field',
name: "岗位姓名",
dataType: "string",

3
src/views/sysworkflow/codepage/createform.vue

@ -25,7 +25,7 @@ import DragControl from '@/components/DesignForm/dragControl.vue';
import HeadTools from '@/components/DesignForm/public/headTools.vue';
// import HeadTools from '@/components/DesignForm/public/headToolsNew.vue';
import FormDesign from '@/components/DesignForm/public/form/form.vue'
import FormControlAttr from '@/components/DesignForm/formControlAttr.vue';
import VueFile from '@/components/DesignForm/vueFile.vue'
import AceDrawer from '@/components/DesignForm/aceDrawer.vue'
@ -888,6 +888,7 @@ const editversionstaus = (id:string) =>{
:form-data="state.formData.form"
:form-config="state.formData.config"
:customerformid="props.formid"
:form-list="state.formData.list"
@open-dialog="openAceEditDrawer"
/>
<ace-drawer

219
src/views/sysworkflow/codepage/page.vue

@ -7,10 +7,90 @@
<el-dialog
v-model="isShow"
title="公式编辑"
width="50%"
width="800px"
:before-close="handleClose"
>
<editor id="tinymce" v-model="tinymceHtml" :init="tinymceInit"></editor>
<div>目标字段 =</div>
<el-row :gutter="20">
<el-col :span="16">
<editor ref="hjks" id="tinymce" v-model="tinymceHtml" :init="tinymceInit"></editor>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('(')">(</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber(')')">)</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('C')">C</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('+')">+</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('1')">1</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('2')">2</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('3')">3</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('-')">-</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('4')">4</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('5')">5</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('6')">6</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('*')">×</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('7')">7</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('8')">8</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('9')">9</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('/')">÷</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('%')">%</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('0')">0</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('.')">.</el-button>
</el-col>
<el-col :span="6">
<el-button plain class="butkey" @click="computeNumber('=')">=</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-button type="primary" @click="testAndVerify">校验公式</el-button>
</el-col>
<el-col :span="16">{{suanShitwo}}</el-col>
<el-col :span="4"></el-col>
</el-row>
<div class="tipBox">{{ errorMsg }}</div>
<el-row :gutter="10">
<el-col :span="6">
@ -18,7 +98,17 @@
<div class="colBoxTitle">当前表单字段</div>
<div class="colBoxContent">
<el-collapse v-model="fieldCurCollapse">
<el-collapse-item v-for="(group,group_idx) in fieldList" :key="group_idx" :title="group.name" :name="group.id">
<div v-for="(i,idx) in group.children" :key="idx" class="item" @mouseenter="itemMouseenter(i)" @mouseleave="itemMouseleave" @click="addTag(i,'field')">
<div class="name">{{i.name}}</div>
<div class="type" :style="typeColors.find(x=>x.name==i.dataType)?.typeStyle">
{{i.dataTypeName}}
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
@ -58,10 +148,16 @@
</div>
</el-col>
</el-row>
{{tinymceHtml}}
<hr />
{{ removeHTMLTag(tinymceHtml) }}
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
<template #footer>
<span class="dialog-footer">
<el-button @click="isShow = false">关闭</el-button>
<el-button type="primary" @click="isShow = false">确定</el-button>
</span>
</template>
</el-dialog>
@ -84,11 +180,13 @@ const tinymceInit = {
language_url: "/tinymce/langs/zh-Hans.js", // public
language: "zh-Hans", // zh-Hans.js
skin_url: "/tinymce/skins/ui/oxide", //
height: 100, //
height: 260, //
statusbar:false,
toolbar:false,
branding: false, //Powered by TinyMCE
menubar: false, //
forced_root_block:'',
newline_behavior:"",
content_css: "/tinymce/skins/content/default/content.css", //csscsscss
}
onMounted(() => {
@ -103,6 +201,9 @@ const funcListw = ref(funcList);
const descContent = ref(""); //
const isShow = ref(true)
const hjks = ref<any>(null)
const tinymceBox = ref(null)
//
const itemMouseenter = (item) => {
descContent.value = item.desc;
@ -113,6 +214,8 @@ const itemMouseleave = () => {
//
const addTag = (data:any,type:string) => {
console.log("tinymce----->",hjks);
let viewStyle = type == "field" ? typeColors.find((x) => x.name == data.dataType)?.viewStyle : typeColors.find((x) => x.name == "func")?.viewStyle;
let viewStyleStr = "margin:0 5px;";
Object.keys(viewStyle).map((key) => {
@ -120,14 +223,112 @@ const addTag = (data:any,type:string) => {
viewStyleStr += `${keyStr}:${viewStyle[key]};`;
});
if (type == "field") {
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span style="${viewStyleStr}" contenteditable="false">${data.name}</span>`);
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span style="${viewStyleStr}" contenteditable="false" data-keyid="${data.id}">${data.name}</span>`);
}else{
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span class="hanshu" style="${viewStyleStr}" contenteditable="false">${data.name}</span><span class="exp" style="${viewStyleStr}" contenteditable="false">(</span><span class="exp" style="${viewStyleStr}" contenteditable="false">)</span>`);
}
// nextTick(()=>{
// })
// console.log("tinymceBox--3--->",fsdf);
// if(tinymceBox.value.childNodes.length >=0){
// tinymceBox.value.childNodes.forEach(element =>{
// console.log("tinymceBox---4-->",element.value.childNodes);
// })
// }
}
const suanShioen = ref<any[]>()
const suanShitwo = ref<any[]>()
//
const testAndVerify = () => {
let pattern = "(<p>)(.*)(<\/p>)";
console.log("tinymceBox----->",tinymceBox);
console.log("tinymceBox--1--->",tinymceBox.value.innerHTML);
console.log("tinymceBox--2--->",tinymceBox.value.innerText);
console.log("tinymceBox--3--->",tinymceBox.value);
let fsdf = tinymceBox.value.innerHTML.match(pattern);
console.log("tinymceBox--4--->",fsdf,fsdf[2]);
console.log("tinymceBox--5--->",tinymceBox.value.childNodes);
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
console.log("element----->",element.childNodes);
element.childNodes.forEach(child => {
console.log("child--classList--->",child.classList);
console.log("child----->",child.innerText,child.data);
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
console.log("child.dataset--222222--->",child.dataset.keyid);
formulaTwo.push(child.dataset.keyid)
}else{
tinymce.activeEditor.execCommand('mceInsertContent', false, `<span style="${viewStyleStr}" contenteditable="false">${data.name}</span>()`);
formulaTwo.push(child.innerText?child.innerText:child.data)
}
// if(child.classList){
// formulaTwo.push(child.innerHTML)
// if(child.classList.value == "hanshu" || child.classList.value == "exp"){
// formulaOne.push(child.innerHTML)
// }
// if(child.dataset && child.dataset.key){
// formulaTwo.push(child.dataset.keyid)
// }
// }else{
// formulaOne.push(child.data)
// formulaTwo.push(child.data)
// }
})
});
console.log("formulaOne------>",formulaOne);
console.log("formulaTwo",formulaTwo);
suanShioen.value = formulaOne.join('').replace(/\s+/g, "");
suanShitwo.value = formulaTwo.join('').replace(/\s+/g, "");
console.log("suanShioen",suanShioen.value);
console.log("suanShitwo",suanShitwo.value);
}
// watch(tinymceBox,() => {
// console.log("tinymceBox----->",tinymceBox);
// },{ deep:true, immediate: true })
const removeHTMLTag = (str:any) => {
// str = str.replace(/<\/?[^>]*>/g, ""); //HTML tag
// str = str.replace(/[ | ]*\n/g, "\n"); //
// str = str.replace(/\n[\s| | ]*\r/g, "\n"); //
// str = str.replace(/&nbsp;/gi, ""); //&nbsp;
return str;
}
/**
* 计算器
*/
const computeNumber = (val:string) =>{
if(val === "C"){
tinymceHtml.value = "";
}else{
tinymce.activeEditor.execCommand('mceInsertContent', false, val);
}
}
</script>
<style lang='scss' scoped>
.butkey{
width:45px;
height:40px;
margin-bottom:15px;
}
.tipBox{
width:100%;
height:30px;
@ -136,9 +337,15 @@ const addTag = (data:any,type:string) => {
.el-row {
// margin-top: 20px;
}
.yincnag{
display:none;
}
.tox-tinymce{
border-radius: 0px;
}
.colBox{
border: 1px solid #eee;
border-radius: 8px;
border-radius: 0px;
.colBoxTitle{
width:100%;
line-height:35px;

9
src/widget/baidumap/index.vue

@ -12,6 +12,12 @@
:rules="itemRules"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<input v-model="value" type="hidden" />
<input v-model="lngLat" type="hidden" />
<el-input v-model="address" >
@ -20,6 +26,7 @@
</template>
</el-input>
<div :id="mapId" ref="myBaiduMapView" class="smallMapView"></div>
</template>
</el-form-item>
<PickMap v-if="mapShow" v-model:mapshow="mapShow" :address="address" :lnglat="lngLat" @updatemapinfo="updateMapInfo" />
</div>
@ -32,7 +39,7 @@ import {
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { FormItem, FormList } from '@/api/DesignForm/types'
import Tooltips from '@/components/DesignForm/tooltip.vue'
import PickMap from './pickmap.vue'

163
src/widget/digitpage/index.vue

@ -4,12 +4,171 @@
@ 备注: 数值控件
-->
<template>
<el-form-item>
<el-form-item
v-bind="data.item"
:prop="tProp || data.name"
:class="config.className"
:rules="itemRules as any"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<el-input v-model="value" oninput ="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^\./g, '')" placeholder="请输入"></el-input>
</template>
</el-form-item>
</template>
<script lang='ts' setup>
const value = ref<any>()
import { orgInfo } from '@/api/hr/org/type'
import { getOrgTreeList } from '@/api/hr/org/index'
import {
constControlChange,
constFormProps,
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { FormItem, FormList } from '@/api/DesignForm/types'
import Tooltips from '@/components/DesignForm/tooltip.vue'
const props = withDefaults(
defineProps<{
data: FormList
tablekey: any
modelValue?: any //
tProp?: string // form-itemprop
}>(),
{}
)
const emits = defineEmits<{
(e: 'update:modelValue', numVal: any): void
}>()
const orgTreeList = ref<orgInfo[]>(); //
const formProps = inject(constFormProps, {}) as any
const type = computed(() => {
return formProps.value.type
})
const config = computed(() => {
return props.data.config || {}
})
const changeEvent = inject(constControlChange, '') as any
const value = computed({
get() {
if (props.tProp) {
//
let zhiVal = props.modelValue
if(zhiVal != null && zhiVal != "") {
zhiVal=zhiVal*1
}
return zhiVal
} else {
let zhiVal = formProps.value.model[props.data.name]
if(zhiVal != null && zhiVal != "") {
zhiVal=zhiVal*1
}
return zhiVal
}
},
set(newVal: any) {
if(newVal != null && newVal != "") {
newVal=newVal*1
}
if (props.tProp) {
emits('update:modelValue', newVal)
}
updateModel(newVal*1)
}
})
const updateModel = (val: any) => {
let controlAttribute = ""
if(props.data.control){
if(props.data.control.type){
controlAttribute = props.data.control.type
}
}
changeEvent &&
changeEvent({
key: props.data.name,
value: val,
data: props.data,
tProp: props.tProp,
type: props.data.type,
attribute: controlAttribute
})
}
const getLabel = (ele: FormItem) => {
const showColon = formProps.value.showColon ? ':' : ''
if (ele) {
return ele.showLabel ? '' : ele.label + showColon
} else {
return ''
}
}
// item
const itemRules = computed(() => {
let temp
const itemR: any = props.data.item?.rules || []
const customR = formatCustomRules()
// undefined
if (itemR?.length || customR?.length) {
temp = [...customR, ...itemR]
}
return temp
})
// customRulesrules
const formatCustomRules = () => {
const rulesReg: any = {}
validate &&
validate.forEach(item => {
rulesReg[item.type] = item.regExp
})
// 使provide
const temp: any = []
props.data.customRules?.forEach((item: any) => {
if (!item.message && item.type !== 'methods') {
return //
}
let obj = {}
if (item.type === 'required') {
obj = { required: true }
} else if (item.type === 'rules') {
//
obj = { pattern: item.rules }
} else if (item.type === 'methods') {
//
const methods: any = item.methods
if (methods) {
obj = { validator: inject(methods, {}) }
}
} else if (item.type) {
obj = { pattern: rulesReg[item.type as string] }
}
// push
let message: any = { message: item.message }
if (!item.message) {
// 使validatormessage使 callback(new Error('x'));
message = {}
}
temp.push(
Object.assign(
{
trigger: item.trigger || 'blur'
},
obj,
message
)
)
})
return temp
}
</script>

11
src/widget/number/index.vue

@ -10,11 +10,11 @@ import {
constGetControlByName
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { useRoute } from 'vue-router'
import { FormItem, FormList } from '@/api/DesignForm/types'
import { gainNumber } from '@/api/DesignForm/requestapi'
import Tooltips from '@/components/DesignForm/tooltip.vue'
const props = withDefaults(
defineProps<{
data: FormList
@ -189,9 +189,16 @@ const formatCustomRules = () => {
:rules="itemRules as any"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<el-input v-model="value" :disabled="editDisabled" placeholder="请输入编码">
<template #prefix>NO.</template>
</el-input>
</template>
</el-form-item>
</template>
<style lang='scss' scoped>

8
src/widget/org/index.vue

@ -13,6 +13,7 @@ import {
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { FormItem, FormList } from '@/api/DesignForm/types'
import Tooltips from '@/components/DesignForm/tooltip.vue'
const props = withDefaults(
defineProps<{
data: FormList
@ -181,6 +182,12 @@ onMounted(() => {
:rules="itemRules as any"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<el-tree-select
v-model="value"
v-loading="orgTreeLoading"
@ -190,6 +197,7 @@ onMounted(() => {
check-strictly
:render-after-expand="false"
/>
</template>
</el-form-item>
</template>
<style lang='scss' scoped>

8
src/widget/orgcitys/index.vue

@ -12,6 +12,7 @@ import {
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { FormItem, FormList } from '@/api/DesignForm/types'
import Tooltips from '@/components/DesignForm/tooltip.vue'
import areaObj from './pca.json';
@ -260,7 +261,14 @@ const initAddressData = () =>{
:rules="itemRules as any"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<el-input v-model="value" :disabled="editDisabled" clearable placeholder="请选择地址" @click="openAddress" />
</template>
</el-form-item>
<el-dialog

8
src/widget/urllink/index.vue

@ -10,6 +10,7 @@ import {
} from '@/api/DesignForm/utils'
import validate from '@/api/DesignForm/validate'
import { FormItem, FormList } from '@/api/DesignForm/types'
import Tooltips from '@/components/DesignForm/tooltip.vue'
const props = withDefaults(
defineProps<{
data: FormList
@ -164,6 +165,12 @@ onMounted(() => {
:rules="itemRules as any"
:label="getLabel(data.item as FormItem)"
>
<template v-if="config.help" #label >
{{ getLabel(data.item) }}
<Tooltips :content="config.help" />
</template>
<div v-if="type === 4" class="form-value" v-html="value"></div>
<template v-else>
<el-input v-model="value">
<template #prepend>
<el-select v-model="urlVal" style="width: 115px">
@ -173,6 +180,7 @@ onMounted(() => {
</template>
<template #append><el-button type="warning" @click="openUrl">访问</el-button></template>
</el-input>
</template>
</el-form-item>
</template>
<style lang='scss' scoped>

Loading…
Cancel
Save