CONTROL-BASE.vue#COLUMN.ftl 15.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<#--  BEGIN:获取父关系路由参数  -->
<#macro getDeResParameters currentView>
  <#if currentView.isPSDEView()>
    [
    <#if currentView.getPSAppDERSPathCount() gt 0>
      <#list currentView.getPSAppDERSPath(currentView.getPSAppDERSPathCount() - 1) as deRSPath>
      <#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
        { pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' }, 
      </#list>
    </#if>
    ]
  <#else>
    []
  </#if>
</#macro>
<#--  END:获取父关系路由参数  -->

<#--  BEGIN:获取视图本身路由参数  -->
<#macro getParameters currentView>
  [
  <#if currentView.isPSDEView()>
    <#assign appDataEntity = currentView.getPSAppDataEntity()/>
    { pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' }, 
    { pathName: '${currentView.getPSDEViewCodeName()?lower_case}', parameterName: '${currentView.getPSDEViewCodeName()?lower_case}' } 
  <#else>
    { pathName: '${currentView.getCodeName()?lower_case}', parameterName: '${currentView.getCodeName()?lower_case}' } 
  </#if>
  ]
</#macro>
<#--  END:获取视图本身路由参数  -->
31 32 33 34 35 36 37 38 39 40 41 42 43 44

<#--  BEGIN:插入空格  -->
<#macro insertBlank num>
  <#assign blank_space = " " />
  <#list 1..num as i>
  ${blank_space}<#t>
  </#list>
</#macro>
<#--  END:插入空格  -->

<#--  BEGIN:表格列标题自定义绘制  -->
<#macro getColumnHeader item blankNum>
<@insertBlank blankNum /><template v-slot:header="{column}">
<@insertBlank blankNum />  <span class="column-header <#if item.getHeaderPSSysCss?? && item.getHeaderPSSysCss()??>${item.getHeaderPSSysCss().getCssName()}</#if>">
45
                         <#if item.getPSSysImage?? && item.getPSSysImage()??>
46
                           <#assign img=item.getPSSysImage()>
47
<@insertBlank blankNum />      <i class='<#if img.getCssClass?? && img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i>
48 49 50 51 52 53
                         </#if>
<@insertBlank blankNum />    {{<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>}}
<@insertBlank blankNum />  </span>
<@insertBlank blankNum /></template>
</#macro>
<#--  END:表格列标题自定义绘制  -->
54 55 56 57 58 59 60 61
<#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../../@MACRO/LANG_FUN.ftl
</#ibizinclude>
<template v-if="getColumnState('${item.getName()?lower_case}')">
<#if item.getColumnType() == 'GROUPGRIDCOLUMN' && item.getPSDEGridColumns()??>
tony001's avatar
tony001 committed
62
<#--  [1]BEGIN:分组列  -->
63
    <el-table-column show-overflow-tooltip :align="'${item.getAlign()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>">
64
    <@getColumnHeader item 4 />
65 66 67 68
    <#list item.getPSDEGridColumns() as column>
        ${P.getPartCode(column,'COLUMN').code}
    </#list>
    </el-table-column>
tony001's avatar
tony001 committed
69
<#--  [1]END:分组列  -->
70
<#elseif item.getColumnType() == 'UAGRIDCOLUMN'>
tony001's avatar
tony001 committed
71
<#--  [2]BEGIN:操作列  -->
tony001's avatar
tony001 committed
72
    <el-table-column :column-key="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'">
73
        <@getColumnHeader item 8 />
74
        <template slot-scope="scope">
75
            <div style="text-align: center;">
tony001's avatar
tony001 committed
76
  <#if item.getPSDEUIActionGroup().getPSDEUIActions()??>
tony001's avatar
tony001 committed
77
    <#list item.getPSDEUIActionGroup().getPSUIActionGroupDetails() as uiactionDetail>
78 79
      <#if uiactionDetail.getPSUIAction?? && uiactionDetail.getPSUIAction()??>
        <#assign uiaction = uiactionDetail.getPSUIAction() />
80 81 82 83
        <#--  取消分割线标签,使用样式替代分割线 start -->
        <#--  @author ljy  -->
        <#--  @update 2020.7.21 -->
        <#--  <#if preUIAction??>
84
                <divider type='vertical' v-show="scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled" ></divider>
85
        </#if>  -->
86 87 88
        <#if !uiactionDetail.isShowCaption()>
                <tooltip :transfer="true" :max-width="600">
        </#if>
89
                <a v-show="scope.row.${uiaction.getUIActionTag()}.visabled" <#if !preUIAction??>:class="{'grid-first-uiaction':scope.row.${uiaction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> <#if preUIAction??>:class="{'grid-uiaction-divider':scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> :style="{'pointer-events':scope.row.${uiaction.getUIActionTag()}.disabled?'none':'auto','color':scope.row.${uiaction.getUIActionTag()}.disabled?'#7b7979':'#2d8cf0'}" @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)">
90
        <#--  取消分割线标签,使用样式替代分割线 end -->
tony001's avatar
tony001 committed
91
                  <#if uiactionDetail.isShowIcon()><i class='<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>'></i></#if>
92
                  <#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getFullCodeName()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if>
tony001's avatar
tony001 committed
93
                </a>
94
        <#if !uiactionDetail.isShowCaption()>
95
                <div slot='content'>{{<#if langbase??>$t('${langbase}.uiactions.<#if uiaction.getPSAppDataEntity?? && uiaction.getPSAppDataEntity()??>${uiaction.getPSAppDataEntity().getCodeName()?lower_case}_</#if>${uiaction.getUIActionTag()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</div>
96 97
                </tooltip>
        </#if>
98
        <#assign preUIAction = uiaction />
99
      </#if>
tony001's avatar
tony001 committed
100 101
    </#list>
  </#if>
102
            </div>
103 104
        </template>
    </el-table-column>
tony001's avatar
tony001 committed
105
<#--  [2]END:操作列  -->
106
<#elseif item.getColumnType() == 'DEFGRIDCOLUMN'>
tony001's avatar
tony001 committed
107
<#--  [3]BEGIN:数据列  -->
tony001's avatar
tony001 committed
108
    <el-table-column show-overflow-tooltip :prop="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'"<#if (!ctrl.isNoSort()) && item.isEnableSort()> :sortable="'custom'"</#if>>
109 110
        <@getColumnHeader item 8 />
        <template v-slot="{row,column,$index}">
111
        <#if (item.render??) || (item.getCodeList()?? && item.getCLConvertMode() == 'FRONT') || item.isEnableRowEdit()>
112 113 114 115 116 117 118 119
        <#--  BEGIN:列绘制、前端绘制代码表、行编辑  -->
            <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>
            <#--  BEGIN:行编辑  -->
              <#if (item.render??)>
              <#--  BEGIN:列绘制  -->
                    <span>${item.render.code}</span>
              <#--  END:列绘制  -->
              <#else>
tony001's avatar
tony001 committed
120
            <template v-if="actualIsOpenEdit && !row.children">
121 122 123
                <app-form-item :error="gridItemsModel[$index][column.property].error">
                    ${P.getEditorCode(item, "GRIDEIDTOR.vue").code}
                </app-form-item>
124 125 126 127 128
            </template>
              </#if>
            <#--  END:行编辑  -->
            </#if>
            <template <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>v-if="!actualIsOpenEdit"</#if>>
tony001's avatar
tony001 committed
129
                <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
130
                <a v-show="row.${item.getPSDEUIAction().getUIActionTag()}.visabled" :disabled="row.${item.getPSDEUIAction().getUIActionTag()}.disabled" :style="{'display': 'block'}" @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
tony001's avatar
tony001 committed
131
                </#if>
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
                <#if (item.render??)>
                <#--  BEGIN:列绘制  -->
                    <span>${item.render.code}</span>
                <#--  END:列绘制  -->
                <#elseif (item.getCodeList()?? && item.getCLConvertMode() == 'FRONT')>
                <#--  BEGIN:前端绘制代码表  --> 
                <#assign codelist = item.getPSCodeList()>
                <#if codelist.getCodeListType() == 'STATIC' || codelist.getCodeListType() == 'DYNAMIC'>
                    <codelist <#t>
                      :value="row.${item.getName()?lower_case}" <#t>
                      <#assign codelist=item.getPSCodeList() />
                      tag='${codelist.codeName}' <#t>
                      codelistType='${codelist.getCodeListType()}' <#t>
                    <#if codelist.getOrMode?? && codelist.getOrMode()?has_content>
                      renderMode="${codelist.getOrMode()}" <#t>
                    </#if>
                    <#if codelist.valueSeparator?has_content>
                      valueSeparator="${codelist.valueSeparator}" <#t>
                    </#if>
                    <#if codelist.textSeparator?has_content>
                      textSeparator="${codelist.textSeparator}" <#t>
                    </#if>><#t>
                    </codelist><#lt>
                </#if>
                <#--  END:前端绘制代码表  -->
                <#else>
                  <#if item.isEnableLinkView()>
                  <#-- 支持链接视图-->
                  <#if item.getLinkPSAppView()??>
                  <#assign dataview = item.getLinkPSAppView() />
                  <#assign appLinkView>
                    viewname: '${srffilepath2(dataview.getCodeName())}', height: ${dataview.getHeight()?c},width: ${dataview.getWidth()?c},title: <@getViewLanguageTitle dataview />,placement: '${dataview.getOpenMode()}', isRedirectView: <#if dataview.isRedirectView()>true<#else>false</#if>,deResParameters: <@getDeResParameters dataview />,parameters: <@getParameters dataview />
                  </#assign>
                  </#if>
166 167 168 169 170 171
                  <app-column-link 
                    deKeyField='<#if dataview.isPSDEView()>${dataview.getPSAppDataEntity().getCodeName()?lower_case}</#if>' 
                    :context="JSON.parse(JSON.stringify(context))" 
                    :viewparams="JSON.parse(JSON.stringify(viewparams))" 
                    :data="row" 
                    :linkview="{<#compress><#if appLinkView??>${appLinkView}</#if></#compress>}"
Mosher's avatar
Mosher committed
172
                    valueitem="<#if item.getLinkValueItem()??>${item.getLinkValueItem()}</#if>">
173 174
                  <#--  BEGIN:常规显示  -->
                  <#if item.getPSDEGridEditItem()?? && item.getPSDEGridEditItem().getPSEditorType?? && item.getPSDEGridEditItem().getPSEditorType()??>
175
                    <app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}"></app-span>
176 177 178 179 180
                  <#else>
                    <span>{{row.${item.getName()?lower_case}}}</span>
                  </#if>
                  </app-column-link>
                  <#else>
181 182
                  <#if item.getPSDEGridEditItem()?? && item.getPSDEGridEditItem().getPSEditorType?? && item.getPSDEGridEditItem().getPSEditorType()??>
                    <app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}" <#t>
183
                    <#if item.getPSDEField().getDataType()!="">
184
                      dataType="${item.getPSDEField().getDataType()}" <#t>
185 186
                    </#if>
                    <#if item.getPSDEField().getPrecision()??>
187
                      precision="${item.getPSDEField().getPrecision()}" <#t></#if>></app-span>
188 189 190 191 192 193 194 195 196 197 198 199
                  <#else>
                  <#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
                    <app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
                  <#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")>
                    <app-format-data dataType="${item.getPSDEField().getDataType()}" precision="${item.getPSDEField().getPrecision()}" :data="row.${item.getName()?lower_case}"></app-format-data>
                  <#else>
                    <span>{{row.${item.getName()?lower_case}}}</span>
                  </#if>
                  </#if>
                  </#if>
                <#--  END:常规显示  -->
                </#if>
tony001's avatar
tony001 committed
200 201 202
                <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
                </a>
                </#if>
203 204 205
            </template>
        <#--  END:列绘制、前端绘制代码表、行编辑  -->
        <#else>
tony001's avatar
tony001 committed
206
          <#if item.isEnableLinkView()>
207
            <#-- 支持链接视图-->
tony001's avatar
tony001 committed
208 209 210 211 212 213
              <#if item.getLinkPSAppView()??>
                <#assign dataview = item.getLinkPSAppView() />
                <#assign appLinkView>
                viewname: '${srffilepath2(dataview.getCodeName())}', height: ${dataview.getHeight()?c},width: ${dataview.getWidth()?c},title: <@getViewLanguageTitle dataview />,placement: '${dataview.getOpenMode()}', isRedirectView: <#if dataview.isRedirectView()>true<#else>false</#if>,deResParameters: <@getDeResParameters dataview />,parameters: <@getParameters dataview />
                </#assign>
              </#if>
214 215 216
            <app-column-link deKeyField='<#if dataview.isPSDEView()>${dataview.getPSAppDataEntity().getCodeName()?lower_case}</#if>' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{<#compress><#if appLinkView??>${appLinkView}</#if></#compress>}" valueitem="<#if item.getLinkValueItem()??>${item.getLinkValueItem()}</#if>">
                <span>{{row.${item.getName()?lower_case}}}</span>
            </app-column-link >
tony001's avatar
tony001 committed
217 218
          <#else>
            <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
219
            <a v-show="row.${item.getPSDEUIAction().getUIActionTag()}.visabled" :disabled="row.${item.getPSDEUIAction().getUIActionTag()}.disabled" :style="{'display': 'block'}" @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
tony001's avatar
tony001 committed
220
            </#if>
221 222 223 224 225 226 227
            <#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
            <app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
            <#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")>
                <app-format-data dataType="${item.getPSDEField().getDataType()}" precision="${item.getPSDEField().getPrecision()}" :data="row.${item.getName()?lower_case}"></app-format-data>
            <#else>
            <span>{{row.${item.getName()?lower_case}}}</span>
            </#if>
tony001's avatar
tony001 committed
228 229
            <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
            </a>
230
            </#if>
tony001's avatar
tony001 committed
231
          </#if>
232 233 234
         </#if>
        </template>
    </el-table-column>
tony001's avatar
tony001 committed
235
<#--  [3]END:数据列  -->
236 237 238
</#if>
</template>