Browse Source

feat: fields 根据 opera 额外控制调整

lanceJiang 3 months ago
parent
commit
eecfcf62d0

+ 3 - 1
src/components/packages/formEditor/components/Layout/InlineLayout.jsx

@@ -3,6 +3,7 @@ import Selection from '@ER/formEditor/components/Selection/selectElement.jsx'
 import LayoutDragGable, { dragGableWrap } from './DragGable.jsx'
 import hooks from '@ER/hooks'
 import utils from '@ER/utils'
+import _ from 'lodash-es'
 import ControlInsertionPlugin from './ControlInsertionPlugin.js'
 export default defineComponent({
   name: 'InlineLayout',
@@ -32,9 +33,10 @@ export default defineComponent({
       direction: 'horizontal'
     }
     return () => {
+      const hiddenClass = _.get(props.data, 'columns[0].options.hidden', false) ? 'hidden' : ''
       return (
         <div
-          class={[ns.b()]}>
+          class={[ns.b(), hiddenClass]}>
           <LayoutDragGable
             data-layout-type={'inline'}
             class={''}

+ 1 - 1
src/components/packages/formEditor/components/Panels/Config/components/PropsPanel.vue

@@ -363,7 +363,7 @@ const handleTypeListener = ({ property, data }) => {
 	switch (property) {
 		case 'width':
 			// eslint-disable-next-line
-      const val = Number((eval(data.value) * 100).toFixed(2))
+			const val = Number((eval(data.value) * 100).toFixed(2))
 			utils.syncWidthByPlatform(target.value, state.platform, false, val)
 			break
 		case 'type':

+ 1 - 1
src/components/packages/theme/formEditor/TableLayout.scss

@@ -1,5 +1,5 @@
 @include b(TableLayout) {
-  padding: 20px !important;
+  padding: 16px !important;
   table {
     width: 100%;
     table-layout: fixed;

+ 7 - 3
src/views/approve/launch/ItemDrawer.vue

@@ -346,11 +346,12 @@ Promise.all([
 			if (matchingFormItem) {
 				// 如果找到匹配的对象,且opera为'2',则删除newFields中的对象
 				if (matchingFormItem.opera === '2') {
-					// fields 配置是准确的
+					_field.options.hidden = true
+					/*// fields 配置是准确的
 					newFields.splice(idx, 1)
 					// list 配置是跟随 fields 配置 顺序来(通过id 查找 id 只在第一次创建 才有效(修改编辑不会同步))
 					newFieldsList.splice(idx, 1)
-					idx--
+					idx--*/
 				} else {
 					// 否则,将opera属性添加到newFields中的对象
 					_field.opera = matchingFormItem.opera
@@ -412,7 +413,10 @@ Promise.all([
 	// 修改everright 表单的样式
 	.self-Everright-formEditor {
 		:deep(.Everright-formEditor-selectElement) {
-			padding: 0px 16px;
+			padding: 4px 8px;
+		}
+		:deep(.Everright-formEditor-TableLayout) {
+			padding: 8px !important;
 		}
 	}
 }