diff --git a/package.json b/package.json
index e253438c0..4f113b7ba 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
]
},
"dependencies": {
- "@element-plus/icons-vue": "^2.1.0",
+ "@element-plus/icons-vue": "^2.3.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vueuse/core": "^10.1.2",
"@wangeditor/editor": "^5.1.23",
diff --git a/src/api/DesignForm/requestapi.ts b/src/api/DesignForm/requestapi.ts
index 5f5c00c4b..bbd78ff83 100644
--- a/src/api/DesignForm/requestapi.ts
+++ b/src/api/DesignForm/requestapi.ts
@@ -261,3 +261,11 @@ export function gainEditFormFlowInfo(data?:enableVersionId){
data: data
});
}
+//获取要修改的数据
+export function gainNumber(data?:any){
+ return request({
+ url: '/systemapi/public/gainNumber',
+ method: 'post',
+ data: data
+ });
+}
diff --git a/src/api/DesignForm/types.ts b/src/api/DesignForm/types.ts
index ecdbc2c9e..9ffa2ed06 100644
--- a/src/api/DesignForm/types.ts
+++ b/src/api/DesignForm/types.ts
@@ -98,6 +98,12 @@ export interface formData{
config: any;
events?:any
}
+//表单基本信息
+export interface formTableInfo{
+ size?: any;
+ name?:any,
+ formName?:any
+}
//其他表单数据
export interface formOtherData{
source: any;
diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts
index b8861bbe3..309673312 100644
--- a/src/components/DesignForm/assembly/index.ts
+++ b/src/components/DesignForm/assembly/index.ts
@@ -199,7 +199,18 @@ const selectOption: any = [
label: '保存'
},
config: {}
- }
+ },
+ {
+ type: 'serialNumber',
+ label: '编码',
+ icon: 'number',
+ iconFont: 'fa-sort-numeric-asc',
+ control: {
+ },
+ config: {
+ automatic:false
+ }
+ }
]
},
{
diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue
index 454f8cdc5..9e6d340d7 100644
--- a/src/components/DesignForm/formControlAttr.vue
+++ b/src/components/DesignForm/formControlAttr.vue
@@ -66,7 +66,29 @@ const state = reactive({
"可参考UI组件表单校验,详情点击",
props: '可添加当前组件所有prop属性及事件方法'
},
- tabsName: 'second'
+ tabsName: 'second',
+ numberRulesList:[
+ {
+ type: 'time',
+ label: '时间',
+ msg:'请选择时间格式'
+ },
+ {
+ type: 'text',
+ label: '自定义字符',
+ msg:'请输入自定义字符'
+ },
+ {
+ type: 'serialnumber',
+ label: '流水序号',
+ msg:'流水号起始值'
+ },
+ {
+ type: 'randomnumber',
+ label: '随机数',
+ msg:'请输入随机数位数'
+ }
+ ]
})
const formAttr = computed(() => {
@@ -1049,6 +1071,23 @@ const delAddRules = (index: number) => {
controlData.value.customRules &&
controlData.value.customRules.splice(index, 1)
}
+
+//添加一条编码规则
+const addNumRules = () => {
+ if (!controlData.value.config.customRules) {
+ controlData.value.config.customRules = []
+ }
+ controlData.value.config.customRules.push({
+ type:'time',
+ rule:"YYYYMMDD"
+ })
+}
+//删除一条编码规则
+const delNumRules = (index: number) => {
+ controlData.value.config.customRules &&
+ controlData.value.config.customRules.splice(index, 1)
+}
+
// 编辑表单样式
const editFormStyle = (tooltip: string) => {
emits('openDialog', {
@@ -1100,7 +1139,7 @@ const getDataSource = () => {
}
// 表单属性修改
const formAttrChange = (obj: any, val?: any) => {
- console.log("表单属性修改--->",obj,val,{ [obj.key]: obj.value })
+ // console.log("表单属性修改--->",obj,val,{ [obj.key]: obj.value })
if (obj.key === 'source') {
getFormFieldBySource(obj.value) // 改变了数据源了,重新请求数据
// 清空设计区已选择的组件,再一次选择时字段标识才会变
@@ -1138,6 +1177,18 @@ const rulesSelectChange = (item: any, val: string) => {
item.message = filter[0].message
}
}
+const rulesSelectNumChange = (item: any, val: string) => {
+ console.log("快速添加校验规则改变时",item,val)
+ const filter = state.numberRulesList.filter(item => item.type === val)
+ if (filter && filter.length) {
+ item.message = filter[0].msg
+ if(val == "time") {
+ item.rule = "YYYYMMDD"
+ }else{
+ item.rule = ""
+ }
+ }
+}
// options动态选项数据源请求时
const optionsEvent = (type: string, tooltip?: string) => {
openAttrDialog(type, tooltip)
@@ -1149,7 +1200,7 @@ getDataSource()
defineExpose({ getFormFieldBySource })
//判断输入框是否可写
const isNotWrite = (val:any) =>{
- console.log("判断输入框是否可写--->",val)
+ // console.log("判断输入框是否可写--->",val)
if(val.key === "name" && props.customerformid != ""){
return true
}
@@ -1265,6 +1316,47 @@ const isNotWrite = (val:any) =>{
增加标签
+
+
+
编码规则配置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加规则
+
+
+
",props.beforeSubmit)
// loading.value = true
- // console.log("apiUrl--->",apiUrl)
- // console.log("submitParams--->",submitParams)
- // console.log("formatParams--->",formatParams)
+ console.log("apiUrl--->",apiUrl)
+ console.log("submitParams--->",submitParams)
+ console.log("formatParams--->",formatParams)
// 提交保存表单
currencyFormApiSubmit(apiUrl, submitParams ?? formatParams)
.then((res: any) => {
@@ -617,7 +619,7 @@ const resetFields = () => {
// setValue(Object.assign(model.value, obj || {})) // 这才能清空组件显示的值
}
onMounted(() => {
- console.log("数据处理结束--->",props.type)
+ console.log("数据处理结束--->",props.formData)
getInitModel()
nextTick(() => {
appendRemoveStyle(true)
@@ -1004,7 +1006,7 @@ defineExpose({
'detail-form': type === 3 || type === 4
}"
>
-
+
diff --git a/src/components/DesignForm/public/form/formGroup.vue b/src/components/DesignForm/public/form/formGroup.vue
index 6734289eb..8753c2524 100644
--- a/src/components/DesignForm/public/form/formGroup.vue
+++ b/src/components/DesignForm/public/form/formGroup.vue
@@ -11,7 +11,7 @@ import ChildTable from './childTable.vue'
import Tooltips from '@/components/DesignForm/tooltip.vue'
import FlexBox from './flexBox.vue'
import { useDesignFormStore } from '@/store/DesignForm/designForm'
-import { FormList } from '@/api/DesignForm/types'
+import { FormList,formTableInfo } from '@/api/DesignForm/types'
import {
constFormBtnEvent,
constFormProps
@@ -22,6 +22,8 @@ import { jsonParseStringify } from '@/utils/DesignForm'
const props = withDefaults(
defineProps<{
data: FormList[]
+ tableinfo:formTableInfo
+ numrun?:number
}>(),
{
data: () => {
@@ -251,6 +253,9 @@ onUnmounted(() => {
store.setActiveKey('')
store.setControlAttr({})
})
+onMounted(()=>{
+ console.log('formGroup onMounted',dataList,props.tableinfo)
+})
{
}"
@add="draggableAdd"
>
+
{
{{ element.control?.label }}
+
-
-
-
+
+
-
+
diff --git a/src/main.ts b/src/main.ts
index c5898bba6..07f9c276a 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -24,7 +24,8 @@ import 'uno.css';
import '@/styles/workflowcss/override-element-ui.scss'
import ComComponents from '@/components/DesignForm/index'
-
+import ComWidget from '@/widget/index'
+import AKDesign from '@/views/sysworkflow/codepage/index'
const app = createApp(App);
// 全局注册 自定义指令(directive)
@@ -32,9 +33,6 @@ setupDirective(app);
// 全局注册 状态管理(store)
setupStore(app);
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
-
-import AKDesign from '@/views/sysworkflow/codepage/index'
-
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
@@ -45,7 +43,7 @@ app.directive('focus', {
}
});
-app.use(router).use(i18n).use(ComComponents).use(ElementPlus, {
+app.use(router).use(i18n).use(ComComponents).use(ComWidget).use(ElementPlus, {
locale: zhCn
}).use(AKDesign).mount('#app');
diff --git a/src/views/sysworkflow/codepage/createform.vue b/src/views/sysworkflow/codepage/createform.vue
index ca6f5c441..112096af3 100644
--- a/src/views/sysworkflow/codepage/createform.vue
+++ b/src/views/sysworkflow/codepage/createform.vue
@@ -282,6 +282,7 @@ const getInitData = () => {
state.previewVisible = true
// eslint-disable-next-line no-case-declarations
let stringPreview = objToStringify(state.formData) // 防止预览窗口数据修改影响
+ console.log("预览数据",stringPreview);
// eslint-disable-next-line no-case-declarations
const formName = state.formData.form.name
// eslint-disable-next-line no-case-declarations
@@ -682,6 +683,8 @@ function writeDataForm(){
}
const openAceEditDrawer = (params: any) => {
const { type, direction, codeType, title, callback, content } = params
+
+
drawer.direction = direction // 窗口位置ltr/rtl
drawer.type = type // 作为窗口唯一标识,在窗口关闭时可根据type作不同处理
drawer.codeType = codeType || '' // 显示代码类型
diff --git a/src/views/taskplatform/taskmanagement/myrequest.vue b/src/views/taskplatform/taskmanagement/myrequest.vue
index 17d76a33a..200ac2752 100644
--- a/src/views/taskplatform/taskmanagement/myrequest.vue
+++ b/src/views/taskplatform/taskmanagement/myrequest.vue
@@ -68,6 +68,7 @@ const editOpenOrClose = ref(false)
* types 记录类型; 1、我的请求;2、待办事宜;3、已办事宜;4:草稿箱
*/
const lookFlowInfo = (val:any,types:number) => {
+ // debugger
operState.value = 1
drawerMyWith.value = myappbox.value?.clientWidth
flowLogInfo.value = val
diff --git a/src/views/taskplatform/taskmanagement/taskcustomerformnew.vue b/src/views/taskplatform/taskmanagement/taskcustomerformnew.vue
index 7ef51a27c..8f60ccaa4 100644
--- a/src/views/taskplatform/taskmanagement/taskcustomerformnew.vue
+++ b/src/views/taskplatform/taskmanagement/taskcustomerformnew.vue
@@ -434,7 +434,7 @@ const sendFlowInfo = ref
()
()
ref="formEl"
:form-data="state.formData"
:type="formType"
+ :numrun="formType"
:dict="state.dict"
request-url="getFormContent"
add-url="saveFormContent"
diff --git a/src/widget/index.ts b/src/widget/index.ts
new file mode 100644
index 000000000..60b97c982
--- /dev/null
+++ b/src/widget/index.ts
@@ -0,0 +1,8 @@
+/**
+ * 自定义控件仓库
+ */
+import serialNumber from './number/index.vue'
+
+export default (app: any) => {
+ app.component('SerialNumber', serialNumber)
+}
diff --git a/src/widget/number/index.vue b/src/widget/number/index.vue
new file mode 100644
index 000000000..6cc1a6a4b
--- /dev/null
+++ b/src/widget/number/index.vue
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+ NO.
+
+
+
+