Browse Source

优化表格状态、结果样式、勾选

liangyan0105 3 years ago
parent
commit
13639dc40d

+ 1 - 1
src/assets/less/mytodo.css

@@ -90,7 +90,7 @@
   font-weight: 400 !important;
 }
 #home .ccfullCalendar /deep/ .fc-day-today {
-  background-color: #bc4749;
+  background-color: #70a288;
   border-radius: 2px;
 }
 #home .ccfullCalendar /deep/ .fc-day-today a {

+ 2 - 1
src/assets/less/mytodo.less

@@ -114,7 +114,8 @@
     }
     // 今天日历显示
     /deep/ .fc-day-today {
-      background-color: #bc4749;
+      // background-color: #bc4749;
+      background-color: #70a288;
       border-radius: 2px;
       a {
         color: white;

+ 520 - 442
src/views/activiti/applyList.vue

@@ -11,7 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="8">
             <a-form-item label="状态">
-              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true" >
+              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true">
                 <a-select-option value="0">草稿</a-select-option>
                 <a-select-option value="1">处理中</a-select-option>
                 <a-select-option value="2">已结束</a-select-option>
@@ -21,7 +21,7 @@
           </a-col>
           <a-col :md="6" :sm="8">
             <a-form-item label="结果">
-              <a-select v-model="queryParam.result" placeholder="请选择" :allowClear="true" >
+              <a-select v-model="queryParam.result" placeholder="请选择" :allowClear="true">
                 <a-select-option value="0">未提交</a-select-option>
                 <a-select-option value="1">处理中</a-select-option>
                 <a-select-option value="2">通过</a-select-option>
@@ -43,92 +43,155 @@
           </a-col>
 
           <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
-                <a-button type="primary"  @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
+            <a-col :md="6" :sm="12">
+              <a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px"
+                >重置</a-button
+              >
             </a-col>
           </span>
           <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="12" :sm="12" >
-                <a-button type="primary" @click="addApply" :loading="addApplyLoading" style="left: 10px"  icon="plus-circle">发起申请</a-button>
+            <a-col :md="12" :sm="12">
+              <a-button
+                type="primary"
+                @click="addApply"
+                :loading="addApplyLoading"
+                style="left: 10px"
+                icon="plus-circle"
+                >发起申请</a-button
+              >
             </a-col>
           </span>
-
         </a-row>
       </a-form>
     </div>
 
-    <!-- table区域-begin -->
-    <a-table :scroll="scroll" bordered
+    <!-- 表-->
+    <a-table
+      bordered
       ref="table"
       size="small"
       rowKey="id"
       :dataSource="dataSource"
       :pagination="ipagination"
       :loading="loading"
-      @change="handleTableChange">
-      <a-table-column title="#"  :width="50">
-        <template slot-scope="t,r,i" >
-          <span> {{i+1}} </span>
+      @change="handleTableChange"
+    >
+      <a-table-column title="#" :width="50" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ i + 1 }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="标题" dataIndex="title"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="标题" dataIndex="title" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="所属流程" dataIndex="processName" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="当前审批环节" dataIndex="currTaskName"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="当前审批环节" dataIndex="currTaskName" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="状态" dataIndex="status"  :width="150" align="center"
-        key="s" :sorter="(a,b)=>a.status - b.status"
+
+      <!-- 状态 -->
+      <a-table-column
+        title="状态"
+        dataIndex="status"
+        :width="100"
+        align="center"
+        key="s"
+        :sorter="(a, b) => a.status - b.status"
       >
-        <template slot-scope="t,r,i">
-          <span :style="{color:getStatus(t).color}"> {{getStatus(t).text}} </span>
+        <template slot-scope="t, r, i">
+          <!-- <span :style="{ color: getStatus(t).color }"> {{ getStatus(t).text }} </span> -->
+          <!-- 草稿 -->
+          <template v-if="r.status == 0">
+            <a-tag color="red">草稿</a-tag>
+          </template>
+
+          <!-- 处理中 -->
+          <template v-if="r.status == 1">
+            <a-tag color="blue">处理中</a-tag>
+          </template>
+
+          <!-- 已结束 -->
+          <template v-if="r.status == 2">
+            <a-tag color="green">已结束</a-tag>
+          </template>
+
+          <!-- 已撤回 -->
+          <template v-if="r.status == 3">
+            <a-tag color="orange">已撤回</a-tag>
+          </template>
         </template>
       </a-table-column>
-      <a-table-column title="结果" dataIndex="result"  :width="150" align="center"
-                      key="result" :sorter="(a,b)=>a.result - b.result"
+
+      <!-- 结果 -->
+      <a-table-column
+        title="结果"
+        dataIndex="result"
+        :width="100"
+        align="center"
+        key="result"
+        :sorter="(a, b) => a.result - b.result"
       >
-        <template slot-scope="t,r,i">
-          <span :style="{color:getResult(t).color}"> {{getResult(t).text}} </span>
+        <template slot-scope="t, r, i">
+          <!-- <span :style="{ color: getResult(t).color }"> {{ getResult(t).text }} </span> -->
+          <!--未提交-->
+          <template v-if="r.status == 0">
+            <a-tag color="#ab947e">未提交</a-tag>
+          </template>
+
+          <!-- 处理中 -->
+          <template v-if="r.status == 1">
+            <a-tag color="#108ee9">处理中</a-tag>
+          </template>
+
+          <!-- 已通过 -->
+          <template v-if="r.status == 2">
+            <a-tag color="#87d068">已通过</a-tag>
+          </template>
+
+          <!-- 已驳回 -->
+          <template v-if="r.status == 3">
+            <a-tag color="#f50">已驳回</a-tag>
+          </template>
         </template>
       </a-table-column>
-      <a-table-column title="创建时间" dataIndex="createTime"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+
+      <!-- 创建时间 -->
+      <a-table-column title="创建时间" dataIndex="createTime" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="提交申请时间" dataIndex="applyTime"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="提交申请时间" dataIndex="applyTime" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="操作" dataIndex=""  align="center" :width="200">
-        <template slot-scope="t,r,i">
+      <a-table-column title="操作" dataIndex="" align="center" :width="200">
+        <template slot-scope="t, r, i">
           <template v-if="r.status == 0">
-            <a href="javascript:void(0);" style="color: #00A0E9" @click="apply(r)" >提交申请</a>
+            <a href="javascript:void(0);" style="color: #00A0E9" @click="apply(r)">提交申请</a>
             <a-divider type="vertical" />
             <a href="javascript:void(0);" @click="edit(r)" style="color: #000000">编辑</a>
             <a-divider type="vertical" />
             <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
-              <a href="javascript:void(0);"  style="color: red">删除</a>
+              <a href="javascript:void(0);" style="color: red">删除</a>
             </a-popconfirm>
-
           </template>
           <template v-else-if="r.status == 1">
-            <a href="javascript:void(0);" @click="cancel(r)"  style="color:#8000ff;">撤回</a>
+            <a href="javascript:void(0);" @click="cancel(r)" style="color:#8000ff;">撤回</a>
             <a-divider type="vertical" />
-            <a href="javascript:void(0);" @click="history(r)" style="color:blue;">查看进度</a>
+            <a href="javascript:void(0);" @click="history(r)" style="color:#217dbb;">审批历史</a>
             <a-divider type="vertical" />
-            <a href="javascript:void(0);" @click="detail(r)" style="color:#999;">表单数据</a>
+            <a href="javascript:void(0);" @click="detail(r)">表单数据</a>
           </template>
           <template v-else-if="(r.status == 2 && r.result == 3) || r.status == 3">
             <a-popconfirm title="确定提交申请吗?" @confirm="() => apply(r)">
@@ -137,51 +200,53 @@
             <a-divider type="vertical" />
             <a href="javascript:void(0);" @click="edit(r)" style="color:#000000;">编辑</a>
             <a-divider type="vertical" />
-            <a href="javascript:void(0);" @click="history(r)" style="color:blue;">审批历史</a>
+            <a href="javascript:void(0);" @click="history(r)" style="color:#217dbb;">审批历史</a>
             <a-divider type="vertical" />
             <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
-              <a href="javascript:void(0);"  style="color: red">删除</a>
+              <a href="javascript:void(0);" style="color: red">删除</a>
             </a-popconfirm>
           </template>
           <template v-else>
-            <a href="javascript:void(0);" @click="detail(r)" style="color:#999;">表单数据</a>
+            <a href="javascript:void(0);" @click="detail(r)">表单数据</a>
             <a-divider type="vertical" />
-            <a href="javascript:void(0);" @click="history(r)" style="color:blue;">审批历史</a>
+            <a href="javascript:void(0);" @click="history(r)" style="color:#217dbb;">审批历史</a>
           </template>
-
         </template>
       </a-table-column>
     </a-table>
-    <!-- table区域-end -->
-    <!--流程申请选择-->
+
+    <!--表单数据-->
     <a-drawer
-      title="选择流程" width="33%"
+      title="选择流程"
+      width="33%"
       placement="right"
       :closable="false"
       @close="processModalVisible = false"
       :visible="processModalVisible"
     >
-    <a-input-search style="margin-bottom: 10px;width: 200px"
-                        placeholder="输入流程名称" @search="onSearchProcess" />
-      <a-empty description="无流程可供选择" v-if="activeKeyAll.length==0" />
+      <a-input-search style="margin-bottom: 10px;width: 200px" placeholder="输入流程名称" @search="onSearchProcess" />
+      <a-empty description="无流程可供选择" v-if="activeKeyAll.length == 0" />
       <div v-else>
-        
         <a-collapse v-model="activeKey">
-          <a-collapse-panel v-for="(value, index)  in activeKeyAll" :header="filterDictText(dictOptions,value)||'未分类'" :key="value">
-            <a-list :grid="{ gutter: 10,column:1}" :dataSource="processDataMap[value]">
+          <a-collapse-panel
+            v-for="(value, index) in activeKeyAll"
+            :header="filterDictText(dictOptions, value) || '未分类'"
+            :key="value"
+          >
+            <a-list :grid="{ gutter: 10, column: 1 }" :dataSource="processDataMap[value]">
               <a-list-item slot="renderItem" slot-scope="item">
                 <a-card>
                   <div slot="title">
                     <a-row>
-                      <a-col span="12" :title="item.name">{{item.name}} </a-col>
+                      <a-col span="12" :title="item.name">{{ item.name }} </a-col>
                       <a-col span="12" style="text-align: right;">
                         <a href="javascript:void (0)" @click="chooseProcess(item)">发起申请</a>
                       </a-col>
                     </a-row>
                   </div>
-                  <b>版本:</b>v.{{item.version}}
-                  <br/>
-                  <b>说明:</b>{{item.description}}
+                  <b>版本:</b>v.{{ item.version }}
+                  <br />
+                  <b>说明:</b>{{ item.description }}
                 </a-card>
               </a-list-item>
             </a-list>
@@ -190,27 +255,38 @@
       </div>
     </a-drawer>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="100%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @afterSubmit="afterSub" @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
+      <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @afterSubmit="afterSub"
+        @close=";(lcModa.visible = false), (lcModa.disabled = false)"
+      ></component>
     </a-modal>
-    <!-- <onl-cgform-auto-modal ref="modal" code="b0bea65bfce141deb0ae3fcb18982d76" /> -->
+
     <!--提交申请表单-->
     <a-modal title="提交申请" v-model="modalVisible" :mask-closable="false" :width="500" :footer="null">
       <div v-if="modalVisible">
         <a-form-item label="选择审批人" v-show="showAssign">
-          <a-select style="width: 100%"
+          <a-select
+            style="width: 100%"
             v-model="form.assignees"
             placeholder="请选择"
             mode="multiple"
             :allowClear="true"
           >
-            <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}</a-select-option>
+            <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
+              item.realname
+            }}</a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item label="下一审批人" v-show="isGateway">
-          <a-alert  type="info" showIcon message="分支网关处不支持自定义选择下一审批人,将自动下发给所有可审批人。">,将发送给下一节点所有人</a-alert>
+          <a-alert type="info" showIcon message="分支网关处不支持自定义选择下一审批人,将自动下发给所有可审批人。"
+            >,将发送给下一节点所有人</a-alert
+          >
         </a-form-item>
         <a-form-item label="优先级" prop="priority">
           <a-select v-model="form.priority" placeholder="请选择" :allowClear="true" style="width: 100%">
@@ -225,17 +301,19 @@
           <a-checkbox v-model="form.sendEmail" disabled>邮件通知</a-checkbox> -->
         </a-form-item>
         <div slot="footer">
-          <a-button type="text" @click="modalVisible=false">取消</a-button>
+          <a-button type="text" @click="modalVisible = false">取消</a-button>
           <div style="display:inline-block;width: 20px;"></div>
           <a-button type="primary" :disabled="submitLoading" @click="applySubmit">提交</a-button>
         </div>
       </div>
     </a-modal>
+
     <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
       <div v-if="modalLsVisible">
         <historicDetail :procInstId="procInstId"></historicDetail>
       </div>
     </a-modal>
+
     <a-modal title="确认撤回" v-model="modalCancelVisible" :mask-closable="false" :width="500">
       <a-form ref="delForm" v-model="cancelForm" :label-width="70" v-if="modalCancelVisible">
         <a-form-item label="撤回原因" prop="reason">
@@ -243,410 +321,410 @@
         </a-form-item>
       </a-form>
       <div slot="footer">
-        <a-button type="text" @click="modalCancelVisible=false">取消</a-button>
+        <a-button type="text" @click="modalCancelVisible = false">取消</a-button>
         <a-button type="primary" :disabled="submitLoading" @click="handelSubmitCancel">提交</a-button>
       </div>
     </a-modal>
   </a-card>
-
 </template>
 
 <script>
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
-  import { filterObj } from '@/utils/util';
-  import JEllipsis from '@/components/jeecg/JEllipsis'
-  import { deleteAction, getAction,downFile } from '@/api/manage'
-  import pick from "lodash.pick";
-  import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
-  import historicDetail from '@/views/activiti/historicDetail'
-  export default {
-    name: "applyList",
-    mixins:[activitiMixin,JeecgListMixin],
-    components: {
-      JEllipsis
-      ,JTreeSelect
-      ,historicDetail
-    },
-    data () {
-      return {
-        description: '我的申请',
-        dictOptions:[],
-        url: {
-          list: "/actBusiness/listData",
-          getProcessDataList: "/activiti_process/listData",
-          delByIds:'/actBusiness/delByIds',
-          getFirstNode:'/actProcessIns/getFirstNode',
-          applyBusiness:'/actBusiness/apply',
-          cancelApply:'/actBusiness/cancel',
-        },
-        // 查询条件
-        queryParam: {
-          createTimeRange:[],
-          keyWord:'',
-        },
-        // 表头
-        labelCol: {
-          xs: { span: 4 },
-          sm: { span: 4 },
-        },
-        wrapperCol: {
-          xs: { span: 20 },
-          sm: { span: 20 },
-        },
-        processModalVisible: null,
-        activeKeyAll: [],
-        activeKey: [],
-        processDataMap: {},
-        searchProcessKey: null,
-        addApplyLoading: false,
-        lcModa: {
-          title:'',
-          disabled:false,
-          visible:false,
-          formComponent : null,
-          isNew : false
-        },
-        form:{
-          priority:0,
-          assignees:[],
-          sendMessage:true
-        },
-        modalVisible: false,
-        showAssign: false,
-        assigneeList: [],
-        isGateway: false,
-        dictPriority: [],
-        submitLoading: false,
-        error: "",
-        /*审批历史*/
-        modalLsVisible: false,
-        procInstId: '',
-        modalCancelVisible: false,
-        cancelForm: {}
-      }
-    },
-    computed:{
-    },
-    methods: {
-
-      initDictConfig() {
-        //初始化字典 - 流程分类
-        initDictOptions('bpm_process_type').then((res) => {
-          if (res.success) {
-            this.dictOptions = res.result;
-          }
-        });
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
+import { filterObj } from '@/utils/util'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import { deleteAction, getAction, downFile } from '@/api/manage'
+import pick from 'lodash.pick'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
+import historicDetail from '@/views/activiti/historicDetail'
+export default {
+  name: 'applyList',
+  mixins: [activitiMixin, JeecgListMixin],
+  components: {
+    JEllipsis,
+    JTreeSelect,
+    historicDetail
+  },
+  data() {
+    return {
+      description: '我的申请',
+      dictOptions: [],
+      url: {
+        list: '/actBusiness/listData',
+        getProcessDataList: '/activiti_process/listData',
+        delByIds: '/actBusiness/delByIds',
+        getFirstNode: '/actProcessIns/getFirstNode',
+        applyBusiness: '/actBusiness/apply',
+        cancelApply: '/actBusiness/cancel'
       },
-      filterDictText(dictOptions, text) {
-        if (dictOptions instanceof Array) {
-          for (let dictItem of dictOptions) {
-            if (text === dictItem.value) {
-              return dictItem.text
-            }
+      // 查询条件
+      queryParam: {
+        createTimeRange: [],
+        keyWord: ''
+      },
+      // 表头
+      labelCol: {
+        xs: { span: 4 },
+        sm: { span: 4 }
+      },
+      wrapperCol: {
+        xs: { span: 20 },
+        sm: { span: 20 }
+      },
+      processModalVisible: null,
+      activeKeyAll: [],
+      activeKey: [],
+      processDataMap: {},
+      searchProcessKey: null,
+      addApplyLoading: false,
+      lcModa: {
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false
+      },
+      form: {
+        priority: 0,
+        assignees: [],
+        sendMessage: true
+      },
+      modalVisible: false,
+      showAssign: false,
+      assigneeList: [],
+      isGateway: false,
+      dictPriority: [],
+      submitLoading: false,
+      error: '',
+      /*审批历史*/
+      modalLsVisible: false,
+      procInstId: '',
+      modalCancelVisible: false,
+      cancelForm: {}
+    }
+  },
+  computed: {},
+  methods: {
+    initDictConfig() {
+      //初始化字典 - 流程分类
+      initDictOptions('bpm_process_type').then(res => {
+        if (res.success) {
+          this.dictOptions = res.result
+        }
+      })
+    },
+    filterDictText(dictOptions, text) {
+      if (dictOptions instanceof Array) {
+        for (let dictItem of dictOptions) {
+          if (text === dictItem.value) {
+            return dictItem.text
           }
         }
-        return text||text=='null'?'':text
-      },
-      getProcessList() {
-        this.addApplyLoading = true;
-        this.postFormAction(this.url.getProcessDataList,{status:1,roles:true}).then(res => {
-          this.activeKeyAll = [];
+      }
+      return text || text == 'null' ? '' : text
+    },
+    getProcessList() {
+      this.addApplyLoading = true
+      this.postFormAction(this.url.getProcessDataList, { status: 1, roles: true })
+        .then(res => {
+          this.activeKeyAll = []
           if (res.success) {
-            var result = res.result||[];
-            if (result.length>0){
-              let searchProcessKey = this.searchProcessKey;
-              if (searchProcessKey){ //过滤条件
-                result = _.filter(result, function(o) { return o.name.indexOf(searchProcessKey)>-1; });
+            var result = res.result || []
+            if (result.length > 0) {
+              let searchProcessKey = this.searchProcessKey
+              if (searchProcessKey) {
+                //过滤条件
+                result = _.filter(result, function(o) {
+                  return o.name.indexOf(searchProcessKey) > -1
+                })
               }
-              this.processDataMap = _.groupBy(result,'categoryId');
+              this.processDataMap = _.groupBy(result, 'categoryId')
               for (const categoryId in this.processDataMap) {
                 this.activeKeyAll.push(categoryId)
               }
-              this.activeKey = this.activeKeyAll;
+              this.activeKey = this.activeKeyAll
             }
-            this.processModalVisible = true;
-          }else {
+            this.processModalVisible = true
+          } else {
             this.$message.warning(res.message)
           }
-        }).finally(()=>this.addApplyLoading = false);
-      },
-      loadData(arg) {
-        console.log("loadData")
-        if(!this.url.list){
-          this.$message.error("请设置url.list属性!")
-          return
+        })
+        .finally(() => (this.addApplyLoading = false))
+    },
+    loadData(arg) {
+      console.log('loadData')
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      var params = this.getQueryParams() //查询条件
+      this.loading = true
+      getAction(this.url.list, params).then(res => {
+        if (res.success) {
+          let records = res.result || []
+          this.dataSource = records
+          this.ipagination.total = records.length
         }
-        //加载数据 若传入参数1则加载第一页的内容
-        if (arg === 1) {
-          this.ipagination.current = 1;
+        if (res.code === 510) {
+          this.$message.warning(res.message)
         }
-        var params = this.getQueryParams();//查询条件
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            let records = res.result||[];
-            this.dataSource = records;
-            this.ipagination.total = records.length;
-          }
-          if(res.code===510){
-            this.$message.warning(res.message)
-          }
-          this.loading = false;
-        })
-      },
-      getQueryParams(){
-        var param = Object.assign({}, this.queryParam,this.isorter);
-        delete param.createTimeRange; // 时间参数不传递后台
-        return filterObj(param);
-      },
+        this.loading = false
+      })
+    },
+    getQueryParams() {
+      var param = Object.assign({}, this.queryParam, this.isorter)
+      delete param.createTimeRange // 时间参数不传递后台
+      return filterObj(param)
+    },
 
-      // 重置
-      searchReset(){
-        var that = this;
-        var logType = that.queryParam.logType;
-        that.queryParam = {}; //清空查询区域参数
-        that.queryParam.logType = logType;
-        that.loadData(this.ipagination.current);
-      },
-      onDateChange: function (value, dateString) {
-        console.log(dateString[0],dateString[1]);
-        this.queryParam.createTime_begin=dateString[0];
-        this.queryParam.createTime_end=dateString[1];
-      },
-      onDateOk(value) {
-        console.log(value);
-      },
+    // 重置
+    searchReset() {
+      var that = this
+      var logType = that.queryParam.logType
+      that.queryParam = {} //清空查询区域参数
+      that.queryParam.logType = logType
+      that.loadData(this.ipagination.current)
+    },
+    onDateChange: function(value, dateString) {
+      console.log(dateString[0], dateString[1])
+      this.queryParam.createTime_begin = dateString[0]
+      this.queryParam.createTime_end = dateString[1]
+    },
+    onDateOk(value) {
+      console.log(value)
+    },
 
-      getStatus(status) {
-        let text = "未知", color = "";
-        if (status == 0) {
-          text = "草稿";
-          color = "default";
-        } else if (status == 1) {
-          text = "处理中";
-          color = "orange";
-        } else if (status == 2) {
-          text = "已结束";
-          color = "blue";
-        } else if (status == 3) {
-          text = "已撤回";
-          color = "magenta";
-        }
-        return {text:text,color:color}
-      },
-      getResult(result) {
-        let text = "未知",
-          color = "";
-        if (result == 0) {
-          text = "未提交";
-          color = "default";
-        } else if (result == 1) {
-          text = "处理中";
-          color = "orange";
-        } else if (result == 2) {
-          text = "已通过";
-          color = "green";
-        } else if (result == 3) {
-          text = "已驳回";
-          color = "red";
-        }
-        return {text:text,color:color}
-      },
-      apply(v) {
-        if (!v.procDefId || v.procDefId == "null") {
-          this.$message.error("流程定义为空");
-          return;
-        }
-        this.form.id = v.id;
-        this.form.procDefId = v.procDefId;
-        this.form.title = v.title;
-        // 加载审批人
-        this.getAction(this.url.getFirstNode,{procDefId:v.procDefId}).then(res => {
-          if (res.success) {
-            if (res.result.type == 3 || res.result.type == 4) {
-              this.isGateway = true;
-              this.modalVisible = true;
-              this.form.firstGateway = true;
-              this.showAssign = false;
-              this.error = "";
-              return;
-            }
-            this.form.firstGateway = false;
-            this.isGateway = false;
-            if (res.result.users && res.result.users.length > 0) {
-              this.error = "";
-              this.assigneeList = res.result.users;
-              // 默认勾选
-              let ids = [];
-              res.result.users.forEach(e => {
-                ids.push(e.username);
-              });
-              this.form.assignees = ids;
-              this.showAssign = true;
-            } else {
-              this.form.assignees = [];
-              this.showAssign = true;
-              this.error = '审批节点未分配候选审批人员,请联系管理员!';
-            }
-            if (this.error){
-              this.$message.error(this.error)
-              return;
-            }
-            this.modalVisible = true;
-          }else {
-            this.$message.error(res.message)
+    getStatus(status) {
+      let text = '未知',
+        color = ''
+      if (status == 0) {
+        text = '草稿'
+        color = 'default'
+      } else if (status == 1) {
+        text = '处理中'
+        color = 'orange'
+      } else if (status == 2) {
+        text = '已结束'
+        color = 'blue'
+      } else if (status == 3) {
+        text = '已撤回'
+        color = 'magenta'
+      }
+      return { text: text, color: color }
+    },
+    getResult(result) {
+      let text = '未知',
+        color = ''
+      if (result == 0) {
+        text = '未提交'
+        color = 'default'
+      } else if (result == 1) {
+        text = '处理中'
+        color = 'orange'
+      } else if (result == 2) {
+        text = '已通过'
+        color = 'green'
+      } else if (result == 3) {
+        text = '已驳回'
+        color = 'red'
+      }
+      return { text: text, color: color }
+    },
+    apply(v) {
+      if (!v.procDefId || v.procDefId == 'null') {
+        this.$message.error('流程定义为空')
+        return
+      }
+      this.form.id = v.id
+      this.form.procDefId = v.procDefId
+      this.form.title = v.title
+      // 加载审批人
+      this.getAction(this.url.getFirstNode, { procDefId: v.procDefId }).then(res => {
+        if (res.success) {
+          if (res.result.type == 3 || res.result.type == 4) {
+            this.isGateway = true
+            this.modalVisible = true
+            this.form.firstGateway = true
+            this.showAssign = false
+            this.error = ''
+            return
           }
-        });
-
-      },
-      applySubmit() {
-        if (this.showAssign && this.form.assignees.length < 1) {
-          this.error = "请至少选择一个审批人";
-          this.$message.error(this.error)
-          return;
+          this.form.firstGateway = false
+          this.isGateway = false
+          if (res.result.users && res.result.users.length > 0) {
+            this.error = ''
+            this.assigneeList = res.result.users
+            // 默认勾选
+            let ids = []
+            res.result.users.forEach(e => {
+              ids.push(e.username)
+            })
+            this.form.assignees = ids
+            this.showAssign = true
+          } else {
+            this.form.assignees = []
+            this.showAssign = true
+            this.error = '审批节点未分配候选审批人员,请联系管理员!'
+          }
+          if (this.error) {
+            this.$message.error(this.error)
+            return
+          }
+          this.modalVisible = true
         } else {
-          this.error = "";
+          this.$message.error(res.message)
         }
-        this.submitLoading = true;
-        var params = Object.assign({},this.form);
-        params.assignees = params.assignees.join(",")
-        this.postFormAction(this.url.applyBusiness,params).then(res => {
+      })
+    },
+    applySubmit() {
+      if (this.showAssign && this.form.assignees.length < 1) {
+        this.error = '请至少选择一个审批人'
+        this.$message.error(this.error)
+        return
+      } else {
+        this.error = ''
+      }
+      this.submitLoading = true
+      var params = Object.assign({}, this.form)
+      params.assignees = params.assignees.join(',')
+      this.postFormAction(this.url.applyBusiness, params)
+        .then(res => {
           if (res.success) {
-            this.$message.success("操作成功");
-            this.loadData();
-            this.modalVisible = false;
-          }else {
+            this.$message.success('操作成功')
+            this.loadData()
+            this.modalVisible = false
+          } else {
             this.$message.error(res.message)
           }
-        }).finally(()=>this.submitLoading = false);
-      },
-      edit(r,isView) {
-        if (!r.routeName) {
-          this.$message.warning(
-            "该流程信息未配置表单,请联系开发人员!"
-          );
-          return;
-        }
-        if(r.routeName.indexOf("外部表单")!=-1){
-          alert("调用其他项目页面")
-        }else if(r.routeName.indexOf("自定义")!=-1){
-          isView = isView||false;
-          this.lcModa.disabled = isView;
-          this.lcModa.title = '修改流程业务信息:'+r.title;
-          if (isView) this.lcModa.title = '查看流程业务信息:'+r.title;
-          let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-          this.lcModa.formComponent = com.component;
-          this.lcModa.isNew = false;
-          this.lcModa.processData = r;
-          this.lcModa.visible = true;
-        }else{
-          isView = isView||false;
-          this.lcModa.disabled = isView;
-          this.lcModa.title = '修改流程业务信息:'+r.title;
-          if (isView) this.lcModa.title = '查看流程业务信息:'+r.title;
-          this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-          this.lcModa.processData = r;
-          this.lcModa.isNew = false;
-          this.lcModa.visible = true;
+        })
+        .finally(() => (this.submitLoading = false))
+    },
+    edit(r, isView) {
+      if (!r.routeName) {
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
+      }
+      if (r.routeName.indexOf('外部表单') != -1) {
+        alert('调用其他项目页面')
+      } else if (r.routeName.indexOf('自定义') != -1) {
+        isView = isView || false
+        this.lcModa.disabled = isView
+        this.lcModa.title = '修改流程业务信息:' + r.title
+        if (isView) this.lcModa.title = '查看流程业务信息:' + r.title
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.isNew = false
+        this.lcModa.processData = r
+        this.lcModa.visible = true
+      } else {
+        isView = isView || false
+        this.lcModa.disabled = isView
+        this.lcModa.title = '修改流程业务信息:' + r.title
+        if (isView) this.lcModa.title = '查看流程业务信息:' + r.title
+        this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+        this.lcModa.processData = r
+        this.lcModa.isNew = false
+        this.lcModa.visible = true
+      }
+    },
+    remove(r) {
+      this.postFormAction(this.url.delByIds, { ids: r.id }).then(res => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.loadData()
+        } else {
+          this.$message.error(res.message)
         }
-      },
-      remove(r) {
-        this.postFormAction(this.url.delByIds,{ids:r.id}).then((res)=>{
-          if (res.success){
-            this.$message.success(res.message)
-            this.loadData();
-          }else {
+      })
+    },
+    cancel(v) {
+      this.cancelForm.id = v.id
+      this.cancelForm.procInstId = v.procInstId
+      this.modalCancelVisible = true
+    },
+    handelSubmitCancel() {
+      this.submitLoading = true
+      this.postFormAction(this.url.cancelApply, this.cancelForm)
+        .then(res => {
+          if (res.success) {
+            this.$message.success('操作成功')
+            this.loadData()
+            this.modalCancelVisible = false
+          } else {
             this.$message.error(res.message)
           }
         })
-      },
-      cancel(v) {
-        this.cancelForm.id = v.id;
-        this.cancelForm.procInstId = v.procInstId;
-        this.modalCancelVisible = true;
-      },
-      handelSubmitCancel() {
-        this.submitLoading = true;
-        this.postFormAction(this.url.cancelApply,this.cancelForm).then(res => {
-          if (res.success) {
-            this.$message.success("操作成功");
-            this.loadData();
-            this.modalCancelVisible = false;
-          }else {
-            this.$message.error(res.message);
-          }
-        }).finally(()=>this.submitLoading = false);
-      },
-      history(v) {
-        if (!v.procInstId) {
-          this.$message.error("流程实例ID不存在");
-          return;
-        }
-        this.procInstId = v.procInstId;
-        this.modalLsVisible = true;
-      },
-      detail(v) {
-        // this.$refs.modal.detail("1","8a8080f079ea4ed50179ea4f6c470001")
-        this.edit(v,true);
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        //TODO 筛选
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
-        }
-        this.ipagination = pagination;
-        // this.loadData();
-      },
-      addApply() {
-        this.getProcessList()
-      },
-      onSearchProcess(value) {
-        this.searchProcessKey = value;
-        this.getProcessList()
-      },
-      chooseProcess(v) {
-        console.log(v)
-        // this.$refs.modal.add("1")
-        if (!v.routeName) {
-          this.$message.warning(
-            "该流程信息未配置表单,请联系开发人员!"
-          );
-          return;
-        }
-        if(v.routeName.indexOf("外部表单")!=-1){
-          alert("调用其他项目页面")
-        }else if(v.routeName.indexOf("自定义")!=-1){
-          this.lcModa.disabled = false;
-          let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-          this.lcModa.formComponent = com.component;
-          this.lcModa.title = '发起流程:'+v.name;
-          this.lcModa.isNew = true;
-          this.lcModa.processData = v;
-          this.lcModa.visible = true;
-        }else{
-          this.lcModa.disabled = false;
-          this.lcModa.formComponent = this.getFormComponent(v.routeName).component;
-          this.lcModa.title = '发起流程:'+v.name;
-          this.lcModa.isNew = true;
-          this.lcModa.processData = v;
-          this.lcModa.visible = true;
-        }
-        
-
-        console.log("发起",v)
-      },
-      afterSub(formData){
-          this.lcModa.visible = false;
-          this.loadData();
-      },
+        .finally(() => (this.submitLoading = false))
+    },
+    history(v) {
+      if (!v.procInstId) {
+        this.$message.error('流程实例ID不存在')
+        return
+      }
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
+    },
+    detail(v) {
+      // this.$refs.modal.detail("1","8a8080f079ea4ed50179ea4f6c470001")
+      this.edit(v, true)
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //分页、排序、筛选变化时触发
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      // this.loadData();
+    },
+    addApply() {
+      this.getProcessList()
+    },
+    onSearchProcess(value) {
+      this.searchProcessKey = value
+      this.getProcessList()
+    },
+    chooseProcess(v) {
+      console.log(v)
+      // this.$refs.modal.add("1")
+      if (!v.routeName) {
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
+      }
+      if (v.routeName.indexOf('外部表单') != -1) {
+        alert('调用其他项目页面')
+      } else if (v.routeName.indexOf('自定义') != -1) {
+        this.lcModa.disabled = false
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.title = '发起流程:' + v.name
+        this.lcModa.isNew = true
+        this.lcModa.processData = v
+        this.lcModa.visible = true
+      } else {
+        this.lcModa.disabled = false
+        this.lcModa.formComponent = this.getFormComponent(v.routeName).component
+        this.lcModa.title = '发起流程:' + v.name
+        this.lcModa.isNew = true
+        this.lcModa.processData = v
+        this.lcModa.visible = true
+      }
 
+      console.log('发起', v)
+    },
+    afterSub(formData) {
+      this.lcModa.visible = false
+      this.loadData()
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
-</style>
+@import '~@assets/less/common.less';
+</style>

+ 149 - 128
src/views/activiti/doneManage.vue

@@ -1,35 +1,33 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
     <a-card>
+      <!-- 搜索重置 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="handleSearch">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="任务名称" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
+              <a-col :md="6" :sm="12">
                 <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
                 <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
-            </a-col>
-          </span>
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
 
+      <!-- 表 -->
       <a-row>
-        <!--:scroll="scroll+150"  -->
-        <a-table :scroll="scroll" bordered
+        <!--:scroll="scroll+150"  :scroll="scroll" -->
+        <a-table
+          bordered
           :loading="loading"
           rowKey="id"
           :dataSource="data"
@@ -37,68 +35,85 @@
           @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ i + 1 }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="任务名称" dataIndex="name"  :width="150" align="center">
-            <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+          <a-table-column title="任务名称" dataIndex="name" :width="100" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
-            <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+          <a-table-column title="所属流程" dataIndex="processName" :width="100" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="委托代办人" dataIndex="owner"  :width="130" align="center">
-            <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+          <a-table-column title="委托代办人" dataIndex="owner" :width="100" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="流程发起人" dataIndex="applyer"  :width="130" align="center">
-            <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+          <a-table-column title="流程发起人" dataIndex="applyer" :width="100" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="优先级" dataIndex="priority"  :width="100" align="center"
-                          key="priority" :sorter="(a,b)=>a.priority - b.priority"
+          <a-table-column
+            title="优先级"
+            dataIndex="priority"
+            :width="80"
+            align="center"
+            key="priority"
+            :sorter="(a, b) => a.priority - b.priority"
           >
             <template slot-scope="t">
-              <span v-if="t==0" style="color: green;"> 普通 </span>
-              <span v-else-if="t==1" style="color: orange;"> 重要 </span>
-              <span v-else-if="t==2" style="color: red;"> 紧急 </span>
+              <span v-if="t == 0" style="color: green;"> 普通 </span>
+              <span v-else-if="t == 1" style="color: orange;"> 重要 </span>
+              <span v-else-if="t == 2" style="color: red;"> 紧急 </span>
               <span v-else style="color: #999;"> 无 </span>
             </template>
           </a-table-column>
-          <a-table-column title="审批操作" dataIndex="deleteReason"  :width="100" align="center">
-            <template slot-scope="t">
-              <span> {{t}} </span>
+
+          <!-- 审批操作 -->
+          <a-table-column title="审批操作" dataIndex="deleteReason" :width="100" align="center">
+            <template slot-scope="t, r, i">
+              <template v-if="r.deleteReason == '审批通过'">
+                <a-tag color="#87d068">{{ t }}</a-tag>
+              </template>
+              <template v-else>
+                <a-tag color="#bf4342">{{ t }}</a-tag>
+              </template>
             </template>
           </a-table-column>
-          <a-table-column title="审批意见" dataIndex="comment"  :width="100" align="center">
+          <a-table-column title="审批意见" dataIndex="comment" :width="100" align="center">
             <template slot-scope="t">
-              <j-ellipsis :value="t" :length="6"/>
+              <j-ellipsis :value="t" :length="6" />
             </template>
           </a-table-column>
-          <a-table-column title="耗时" dataIndex="duration"  :width="100" align="center"
-                          key="duration" :sorter="(a,b)=>a.duration - b.duration"
-                          >
+          <a-table-column
+            title="耗时"
+            dataIndex="duration"
+            :width="60"
+            align="center"
+            key="duration"
+            :sorter="(a, b) => a.duration - b.duration"
+          >
             <template slot-scope="t">
-              <span> {{millsToTime(t)}} </span>
+              <span> {{ millsToTime(t) }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="创建时间" dataIndex="createTime"  :width="150" align="center">
+          <a-table-column title="创建时间" dataIndex="createTime" :width="130" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex="action"   align="center" :width="150">
-            <template slot-scope="t,r,i">
-              <a href="javascript:void(0);" @click="detail(r)" >表单数据</a>
+          <a-table-column title="操作" dataIndex="action" align="center" :width="150">
+            <template slot-scope="t, r, i">
+              <a href="javascript:void(0);" @click="detail(r)">表单数据</a>
               <a-divider type="vertical" />
-              <a href="javascript:void(0);" @click="history(r)" >审批历史</a>
+              <a href="javascript:void(0);" @click="history(r)" style="color: #217dbb">审批历史</a>
               <a-divider type="vertical" />
               <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
                 <a style="color: red;">删除</a>
@@ -108,27 +123,33 @@
         </a-table>
       </a-row>
     </a-card>
-    <!---->
+
+    <!--审批历史-->
     <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="100%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
+      <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @close=";(lcModa.visible = false), (lcModa.disabled = false)"
+      ></component>
     </a-modal>
   </div>
 </template>
 
 <script>
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 export default {
-  name: "done-manage",
-  mixins:[activitiMixin,JeecgListMixin],
+  name: 'done-manage',
+  mixins: [activitiMixin, JeecgListMixin],
   data() {
     return {
       openSearch: true,
@@ -138,18 +159,18 @@ export default {
       selectList: [], // 多选数据
       searchForm: {
         // 搜索框对应data对象
-        name: "",
+        name: '',
         pageNumber: 1, // 当前页数
         pageSize: 10, // 页面大小
-        sort: "createTime", // 默认排序字段
-        order: "desc" // 默认排序方式
+        sort: 'createTime', // 默认排序字段
+        order: 'desc' // 默认排序方式
       },
       modalType: 0, // 添加或编辑标识
       modalVisible: false, // 添加或编辑显示
-      modalTitle: "", // 添加或编辑标题
+      modalTitle: '', // 添加或编辑标题
       form: {
         // 添加或编辑表单对象初始化数据
-        reason: ""
+        reason: ''
       },
       formValidate: {
         // 表单验证规则
@@ -157,112 +178,112 @@ export default {
       submitLoading: false, // 添加或编辑提交状态
       data: [], // 表数据
       total: 0, // 表数据总数
-      deleteId: "",
-      url:{
-        doneList:'/actTask/doneList',
-        deleteHistoricTask:'/actTask/deleteHistoric/'
+      deleteId: '',
+      url: {
+        doneList: '/actTask/doneList',
+        deleteHistoricTask: '/actTask/deleteHistoric/'
       },
       modalLsVisible: false,
       procInstId: '',
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
-      },
-    };
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false
+      }
+    }
   },
   mounted() {
-    this.init();
+    this.init()
   },
   methods: {
-    loadData(){},
+    loadData() {},
     init() {
-      this.getDataList();
+      this.getDataList()
     },
     getDataList() {
-      this.loading = true;
-      this.postFormAction(this.url.doneList,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.postFormAction(this.url.doneList, this.searchForm).then(res => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result||[];
-        }else {
+          this.data = res.result || []
+        } else {
           this.$message.error(res.message)
         }
-      });
+      })
     },
     handleSearch() {
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
-      this.getDataList();
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
+      this.getDataList()
     },
     handleReset() {
-      this.searchForm={};
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
+      this.searchForm = {}
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     handelCancel() {
-      this.modalVisible = false;
+      this.modalVisible = false
     },
     detail(r) {
       if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
       }
-      if(r.routeName.indexOf("外部表单")!=-1){//外部项目开发的表单
-          alert("调用其他项目页面")
-      }else if(r.routeName.indexOf("自定义")!=-1){//自定义的表单流程
-        this.lcModa.disabled = true;
-        this.lcModa.title = '查看流程业务信息:'+r.processName;
-        let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-        this.lcModa.formComponent = com.component;
-        this.lcModa.isNew = false;
-        this.lcModa.processData = r;
-        this.lcModa.visible = true;
-      }else{//固定的表单
-        this.lcModa.disabled = true;
-        this.lcModa.title = '查看流程业务信息:'+r.processName;
-        this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-        this.lcModa.processData = r;
-        this.lcModa.isNew = false;
-        this.lcModa.visible = true;
+      if (r.routeName.indexOf('外部表单') != -1) {
+        //外部项目开发的表单
+        alert('调用其他项目页面')
+      } else if (r.routeName.indexOf('自定义') != -1) {
+        //自定义的表单流程
+        this.lcModa.disabled = true
+        this.lcModa.title = '查看流程业务信息:' + r.processName
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.isNew = false
+        this.lcModa.processData = r
+        this.lcModa.visible = true
+      } else {
+        //固定的表单
+        this.lcModa.disabled = true
+        this.lcModa.title = '查看流程业务信息:' + r.processName
+        this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+        this.lcModa.processData = r
+        this.lcModa.isNew = false
+        this.lcModa.visible = true
       }
     },
     history(v) {
       if (!v.procInstId) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.procInstId;
-      this.modalLsVisible = true;
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
     },
     remove(v) {
-      this.postFormAction(this.url.deleteHistoricTask+v.id).then(res => {
+      this.postFormAction(this.url.deleteHistoricTask + v.id).then(res => {
         if (res.success) {
-          this.$message.success("操作成功");
-          this.getDataList();
-        }else {
-          this.$message.error(res.message);
+          this.$message.success('操作成功')
+          this.getDataList()
+        } else {
+          this.$message.error(res.message)
         }
-      });
+      })
     },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       //TODO 筛选
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
+      this.ipagination = pagination
       // this.loadData();
-    },
+    }
   },
-  watch: {
-  }
-};
-</script>
+  watch: {}
+}
+</script>

File diff suppressed because it is too large
+ 743 - 742
src/views/activiti/form/demoForm2.vue


+ 330 - 318
src/views/activiti/todoManage.vue

@@ -1,28 +1,26 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
-
     <a-card>
+      <!-- 查询 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="handleSearch">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="任务名称" prop="name" >
-                <a-input
-                  type="text" allowClear
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                />
+              <a-form-item label="任务名称" prop="name">
+                <a-input type="text" allowClear v-model="searchForm.name" placeholder="请输入" />
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="handleSearch" icon="search">查询</a-button>
-                <a-button type="primary"  @click="handleReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
-            </a-col>
-          </span>
+              <a-col :md="6" :sm="12">
+                <a-button type="primary" style="left: 10px" @click="handleSearch" icon="search">查询</a-button>
+                <a-button type="primary" @click="handleReset" icon="reload" style="margin-left: 8px;left: 10px"
+                  >重置</a-button
+                >
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
@@ -32,68 +30,88 @@
         <a-button @click="getDataList" icon="md-refresh">刷新</a-button>
       </a-row>-->
       <a-row>
-        <a-table :scroll="scroll" bordered
-          :loading="loading" rowKey="id"
+        <!-- :scroll="scroll" -->
+        <a-table
+          bordered
+          :loading="loading"
+          rowKey="id"
           :dataSource="data"
-          :pagination="ipagination" @change="handleTableChange"
+          :pagination="ipagination"
+          @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50" align="center">
+            <template slot-scope="t, r, i">
+              <span> {{ i + 1 }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="任务名称" dataIndex="name"  :width="150" align="center">
+          <a-table-column title="任务名称" dataIndex="name" :width="200" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
+          <a-table-column title="所属流程" dataIndex="processName" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="委托代办人" dataIndex="owner"  align="center" :width="150">
+          <a-table-column title="委托代办人" dataIndex="owner" align="center" :width="150">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
           <a-table-column title="流程发起人" dataIndex="applyer" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span> {{ t }} </span>
             </template>
           </a-table-column>
-          <a-table-column title="优先级" dataIndex="priority" :width="110" align="center"
-            key="so" :sorter="(a,b)=>a.priority - b.priority"
+
+          <!-- 优先级 -->
+          <a-table-column
+            title="优先级"
+            dataIndex="priority"
+            :width="150"
+            align="center"
+            key="so"
+            :sorter="(a, b) => a.priority - b.priority"
           >
             <template slot-scope="t">
-              <span v-if="t==0" style="color: green;"> 普通 </span>
-              <span v-else-if="t==1" style="color: orange;"> 重要 </span>
-              <span v-else-if="t==2" style="color: red;"> 紧急 </span>
+              <span v-if="t == 0" style="color: green;"> 普通 </span>
+              <span v-else-if="t == 1" style="color: orange;"> 重要 </span>
+              <span v-else-if="t == 2" style="color: red;"> 紧急 </span>
               <span v-else style="color: #999;"> 无 </span>
             </template>
           </a-table-column>
-          <a-table-column title="状态" dataIndex="isSuspended" :width="100" align="center"
-                          key="z" :sorter="(a,b)=>Boolean(a.isSuspended)?0:1 - Boolean(b.isSuspended)?0:1"
+
+          <!-- 状态 -->
+          <a-table-column
+            title="状态"
+            dataIndex="isSuspended"
+            :width="150"
+            align="center"
+            key="z"
+            :sorter="(a, b) => (Boolean(a.isSuspended) ? 0 : 1 - Boolean(b.isSuspended) ? 0 : 1)"
           >
             <template slot-scope="t">
-              <span v-if="!Boolean(t)" style="color: green;"> 已激活 </span>
-              <span v-if="Boolean(t)" style="color: orange;"> 已挂起 </span>
+              <a-tag color="green" v-if="!Boolean(t)">已激活</a-tag>
+              <a-tag color="orange" v-if="Boolean(t)">已挂起</a-tag>
             </template>
           </a-table-column>
-          <a-table-column title="创建时间" dataIndex="createTime" :width="200" align="center">
+          <a-table-column title="创建时间" dataIndex="createTime" :width="220" align="center">
             <template slot-scope="t">
-              <span>{{t}}</span>
+              <span>{{ t }}</span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex=""  align="center" >
-            <template slot-scope="t,r,i">
+          <a-table-column title="操作" dataIndex="" align="center">
+            <template slot-scope="t, r, i">
               <a href="javascript:void(0);" @click="detail(r)" style="color: blue">申请详情</a>
               <a-divider type="vertical" />
-              <span v-if="Boolean(r.isSuspended)" style="cursor: no-drop;color: #999999;" title="流程已被挂起,无法操作!">
-                通过 <a-divider type="vertical" />
-                驳回 <a-divider type="vertical" />
-                委托 <a-divider type="vertical" />
+              <span
+                v-if="Boolean(r.isSuspended)"
+                style="cursor: no-drop;color: #999999;"
+                title="流程已被挂起,无法操作!"
+              >
+                通过 <a-divider type="vertical" /> 驳回 <a-divider type="vertical" /> 委托 <a-divider type="vertical" />
               </span>
               <span v-else>
                 <a href="javascript:void(0);" @click="passTask(r)" style="color: green">通过</a>
@@ -103,69 +121,67 @@
                 <a href="javascript:void(0);" @click="delegateTask(r)" style="color: #00A0E9">委托</a>
                 <a-divider type="vertical" />
               </span>
-              <a href="javascript:void(0);" @click="history(r)" style="color: #217dbb">历史</a>
+              <a href="javascript:void(0);" @click="history(r)" style="color: #217dbb">审批历史</a>
             </template>
           </a-table-column>
         </a-table>
       </a-row>
     </a-card>
-    <!---->
+
+    <!--审批历史-->
     <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
+
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="100%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false" @getDataList="getDataList"></component>
+    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
+      <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @close=";(lcModa.visible = false), (lcModa.disabled = false)"
+        @getDataList="getDataList"
+      ></component>
     </a-modal>
+
     <!-- 审批操作 -->
     <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500">
-
-      <div  v-if="modalTaskVisible">
+      <div v-if="modalTaskVisible">
         <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
           <a-form-item label="审批意见" prop="reason">
             <a-input type="textarea" v-model="form.comment" :rows="4" />
           </a-form-item>
           <a-form-item label="下一审批人" prop="assignees" v-show="showAssign" :error="error">
-            <a-select
-              v-model="form.assignees"
-              placeholder="请选择"
-              allowClear
-              mode="multiple"
-              :loading="userLoading"
-            >
-              <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}</a-select-option>
+            <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
+              <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
+                item.realname
+              }}</a-select-option>
             </a-select>
           </a-form-item>
           <a-form-item label="下一审批人" v-show="isGateway">
             <span>分支网关处暂不支持自定义选择下一审批人,将发送给下一节点所有人</span>
           </a-form-item>
-          <div v-show="form.type==1">
+          <div v-show="form.type == 1">
             <a-form-item label="驳回至">
-              <a-select
-                v-model="form.backTaskKey"
-                :loading="backLoading"
-                @change="changeBackTask"
-              >
-                <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{item.name}}</a-select-option>
+              <a-select v-model="form.backTaskKey" :loading="backLoading" @change="changeBackTask">
+                <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{
+                  item.name
+                }}</a-select-option>
               </a-select>
             </a-form-item>
-            <a-form-item label="指定原节点审批人" prop="assignees" v-show="form.backTaskKey!=-1" :error="error">
-              <a-select
-                v-model="form.assignees"
-                placeholder="请选择"
-                allowClear
-                mode="multiple"
-                :loading="userLoading"
-              >
-                <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}</a-select-option>
+            <a-form-item label="指定原节点审批人" prop="assignees" v-show="form.backTaskKey != -1" :error="error">
+              <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
+                <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
+                  item.realname
+                }}</a-select-option>
               </a-select>
             </a-form-item>
           </div>
-          <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type==2">
+          <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type == 2">
             <JSelectUserByDep v-model="form.userId" :multi="false"></JSelectUserByDep>
           </a-form-item>
           <a-form-item label="消息通知">
@@ -176,7 +192,7 @@
         </a-form>
       </div>
       <div slot="footer">
-        <a-button type="text" @click="modalTaskVisible=false">取消</a-button>
+        <a-button type="text" @click="modalTaskVisible = false">取消</a-button>
         <a-button type="primary" :loading="submitLoading" @click="handelSubmit">提交</a-button>
       </div>
     </a-modal>
@@ -190,12 +206,12 @@ import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
 import MyIframe from '../../share/modal/MyIframe'
 export default {
-  name: "todo-manage",
-  mixins:[activitiMixin,JeecgListMixin],
-  components:{JSelectUserByDep,MyIframe},
+  name: 'todo-manage',
+  mixins: [activitiMixin, JeecgListMixin],
+  components: { JSelectUserByDep, MyIframe },
   data() {
     return {
-      editorJumpUrl:'',//申请详情跳转外部项目的地址
+      editorJumpUrl: '', //申请详情跳转外部项目的地址
       openSearch: true,
       openTip: true,
       loading: true, // 表单加载状态
@@ -207,26 +223,26 @@ export default {
       assigneeList: [],
       backList: [
         {
-          key: "-1",
-          name: "发起人"
+          key: '-1',
+          name: '发起人'
         }
       ],
-      error: "",
+      error: '',
       showAssign: false,
       searchForm: {
         // 搜索框对应data对象
-        name: "",
+        name: ''
       },
-      modalTaskTitle: "",
-      modalTitle: "", // 添加或编辑标题
+      modalTaskTitle: '',
+      modalTitle: '', // 添加或编辑标题
       form: {
-        id: "",
-        userId: "",
-        procInstId: "",
-        comment: "",
+        id: '',
+        userId: '',
+        procInstId: '',
+        comment: '',
         type: 0,
         assignees: [],
-        backTaskKey: "-1",
+        backTaskKey: '-1',
         sendMessage: true,
         sendSms: false,
         sendEmail: false
@@ -240,355 +256,351 @@ export default {
       dictPriority: [],
       isGateway: false,
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false
       },
-      url:{
-        todoList:'/actTask/todoList',
-        pass:'/actTask/pass',
-        back:'/actTask/back',
-        backToTask:'/actTask/backToTask',
-        delegate:'/actTask/delegate',
-        getNextNode:'/activiti_process/getNextNode',
-        getNode:'/activiti_process/getNode/',
-        getBackList:'/actTask/getBackList/',
-        passAll:'/actTask/passAll/',
-        backAll:'/actTask/backAll/',
+      url: {
+        todoList: '/actTask/todoList',
+        pass: '/actTask/pass',
+        back: '/actTask/back',
+        backToTask: '/actTask/backToTask',
+        delegate: '/actTask/delegate',
+        getNextNode: '/activiti_process/getNextNode',
+        getNode: '/activiti_process/getNode/',
+        getBackList: '/actTask/getBackList/',
+        passAll: '/actTask/passAll/',
+        backAll: '/actTask/backAll/'
       },
       /*历史*/
       modalLsVisible: false,
-      procInstId:''
-    };
+      procInstId: ''
+    }
   },
   mounted() {
-    this.init();
+    this.init()
   },
   methods: {
-    forminitial(){
-      this.form= {
-        id: "",
-        userId: "",
-        procInstId: "",
-        comment: "",
+    forminitial() {
+      this.form = {
+        id: '',
+        userId: '',
+        procInstId: '',
+        comment: '',
         type: 0,
         assignees: [],
-        backTaskKey: "-1",
+        backTaskKey: '-1',
         sendMessage: true,
         sendSms: false,
         sendEmail: false
       }
     },
     init() {
-      this.getDataList();
+      this.getDataList()
     },
-    loadData(){},
+    loadData() {},
     getDataList() {
-      this.loading = true;
-      this.postFormAction(this.url.todoList,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.postFormAction(this.url.todoList, this.searchForm).then(res => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result||[];
-          this.total = this.data.leading;
+          this.data = res.result || []
+          this.total = this.data.leading
         }
-      });
+      })
     },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
+      this.ipagination = pagination
       // this.loadData();
     },
     handleSearch() {
-      this.getDataList();
+      this.getDataList()
     },
     handleReset() {
-      this.searchForm={};
+      this.searchForm = {}
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     showSelect(e) {
-      this.selectList = e;
-      this.selectCount = e.length;
+      this.selectList = e
+      this.selectCount = e.length
     },
     clearSelectAll() {
-      this.$refs.table.selectAll(false);
+      this.$refs.table.selectAll(false)
     },
     handelSubmit() {
-      console.log("提交")
-      this.submitLoading = true;
-      var formData = Object.assign({},this.form);
-      formData.assignees = formData.assignees.join(",");
+      console.log('提交')
+      this.submitLoading = true
+      var formData = Object.assign({}, this.form)
+      formData.assignees = formData.assignees.join(',')
       if (formData.type == 0) {
         // 通过
         if (this.showAssign && formData.assignees.length < 1) {
-          this.$message.error("请至少选择一个审批人")
-          this.submitLoading = false;
-          return;
+          this.$message.error('请至少选择一个审批人')
+          this.submitLoading = false
+          return
         } else {
-          this.error = "";
+          this.error = ''
         }
-        this.postFormAction(this.url.pass,formData).then(res => {
-          this.submitLoading = false;
+        this.postFormAction(this.url.pass, formData).then(res => {
+          this.submitLoading = false
           if (res.success) {
-            this.$message.success("操作成功");
-            this.modalTaskVisible = false;
-            this.getDataList();
+            this.$message.success('操作成功')
+            this.modalTaskVisible = false
+            this.getDataList()
           }
-        });
+        })
       } else if (formData.type == 1) {
         // 驳回
-        if (formData.backTaskKey == "-1") {
+        if (formData.backTaskKey == '-1') {
           // 驳回至发起人
-          this.postFormAction(this.url.back,formData).then(res => {
-            this.submitLoading = false;
+          this.postFormAction(this.url.back, formData).then(res => {
+            this.submitLoading = false
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalTaskVisible = false;
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
             }
-          });
+          })
         } else {
           // 自定义驳回
-          if (formData.backTaskKey != "-1" && formData.assignees.length < 1) {
-            this.$message.error("请至少选择一个审批人")
-            this.submitLoading = false;
-            return;
+          if (formData.backTaskKey != '-1' && formData.assignees.length < 1) {
+            this.$message.error('请至少选择一个审批人')
+            this.submitLoading = false
+            return
           } else {
-            this.error = "";
+            this.error = ''
           }
-          this.postFormAction(this.url.backToTask,formData).then(res => {
-            this.submitLoading = false;
+          this.postFormAction(this.url.backToTask, formData).then(res => {
+            this.submitLoading = false
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalTaskVisible = false;
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
             }
-          });
+          })
         }
       } else if (formData.type == 2) {
         // 委托
         if (!formData.userId) {
-          this.$message.error("请选择一委托人")
-          this.submitLoading = false;
-          return;
+          this.$message.error('请选择一委托人')
+          this.submitLoading = false
+          return
         } else {
-          this.error = "";
+          this.error = ''
         }
-        this.postFormAction(this.url.delegate,formData).then(res => {
-          this.submitLoading = false;
+        this.postFormAction(this.url.delegate, formData).then(res => {
+          this.submitLoading = false
           if (res.success) {
-            this.$message.success("操作成功");
-            this.modalTaskVisible = false;
-            this.getDataList();
+            this.$message.success('操作成功')
+            this.modalTaskVisible = false
+            this.getDataList()
           }
-        });
+        })
       }
     },
     detail(r) {
       if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
       }
-      r.operationType="1";//代办
-      if(r.routeName.indexOf("外部表单")!=-1){//其他项目的表单流程
-          var id=r.tableId;//项目管理合同数据id
-          //打开MyIframe弹框
-          this.$refs.MyIframe.editorVisible=true;
-          //并传入地址参数
-          this.$refs.MyIframe.editorJumpUrlMy='http://localhost:4200/#/contract-process-view?id='+id;
-      }else if(r.routeName.indexOf("自定义")!=-1){//自定义的表单流程
-        this.lcModa.disabled = true;
-        this.lcModa.title = '查看流程业务信息:'+r.processName;
-        let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-        this.lcModa.formComponent = com.component;
-        this.lcModa.isNew = false;
-        this.lcModa.processData = r;
-        this.lcModa.visible = true;
-      }else{//固定的表单流程
-        this.lcModa.disabled = true;
-        this.lcModa.title = '查看流程业务信息:'+r.processName;
-        this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-        this.lcModa.processData = r;
-        this.lcModa.isNew = false;
-        this.lcModa.visible = true;
+      r.operationType = '1' //代办
+      if (r.routeName.indexOf('外部表单') != -1) {
+        //其他项目的表单流程
+        var id = r.tableId //项目管理合同数据id
+        //打开MyIframe弹框
+        this.$refs.MyIframe.editorVisible = true
+        //并传入地址参数
+        this.$refs.MyIframe.editorJumpUrlMy = 'http://localhost:4200/#/contract-process-view?id=' + id
+      } else if (r.routeName.indexOf('自定义') != -1) {
+        //自定义的表单流程
+        this.lcModa.disabled = true
+        this.lcModa.title = '查看流程业务信息:' + r.processName
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.isNew = false
+        this.lcModa.processData = r
+        this.lcModa.visible = true
+      } else {
+        //固定的表单流程
+        this.lcModa.disabled = true
+        this.lcModa.title = '查看流程业务信息:' + r.processName
+        this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+        this.lcModa.processData = r
+        this.lcModa.isNew = false
+        this.lcModa.visible = true
       }
     },
     passTask(v) {
       this.forminitial()
-      this.modalTaskTitle = "审批通过";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.priority = v.priority;
-      this.form.type = 0;
-      this.modalTaskVisible = true;
-      this.userLoading = true;
-      this.getAction(this.url.getNextNode,{procDefId:v.procDefId, currActId:v.key,procInstId:v.procInstId}).then(res => {
-        this.userLoading = false;
-        if (res.success) {
-          if (res.result.type == 3 || res.result.type == 4) {
-            this.isGateway = true;
-            this.showAssign = false;
-            this.error = "";
-            return;
-          }
-          this.isGateway = false;
-          if (res.result.users && res.result.users.length > 0) {
-            this.error = "";
-            this.assigneeList = res.result.users;
-            // 默认勾选
-            let ids = [];
-            res.result.users.forEach(e => {
-              ids.push(e.username);
-            });
-            this.form.assignees = ids;
-            this.showAssign = true;
-          } else {
-            this.form.assignees = [];
-            this.showAssign = false;
+      this.modalTaskTitle = '审批通过'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.priority = v.priority
+      this.form.type = 0
+      this.modalTaskVisible = true
+      this.userLoading = true
+      this.getAction(this.url.getNextNode, { procDefId: v.procDefId, currActId: v.key, procInstId: v.procInstId }).then(
+        res => {
+          this.userLoading = false
+          if (res.success) {
+            if (res.result.type == 3 || res.result.type == 4) {
+              this.isGateway = true
+              this.showAssign = false
+              this.error = ''
+              return
+            }
+            this.isGateway = false
+            if (res.result.users && res.result.users.length > 0) {
+              this.error = ''
+              this.assigneeList = res.result.users
+              // 默认勾选
+              let ids = []
+              res.result.users.forEach(e => {
+                ids.push(e.username)
+              })
+              this.form.assignees = ids
+              this.showAssign = true
+            } else {
+              this.form.assignees = []
+              this.showAssign = false
+            }
           }
         }
-      });
+      )
     },
     changeBackTask(v) {
       console.log(this.url.getNode)
-      
+
       console.log(v)
       console.log(this.form.procInstId)
-      if (v == "-1") {
-        return;
+      if (v == '-1') {
+        return
       }
-      this.userLoading = true;
-      this.getAction(this.url.getNode+v+"&"+this.form.procInstId).then(res => {
-        this.userLoading = false;
+      this.userLoading = true
+      this.getAction(this.url.getNode + v + '&' + this.form.procInstId).then(res => {
+        this.userLoading = false
         if (res.success) {
           if (res.result.users && res.result.users.length > 0) {
-            this.assigneeList = res.result.users;
+            this.assigneeList = res.result.users
             // 默认勾选
-            let ids = [];
+            let ids = []
             res.result.users.forEach(e => {
-              ids.push(e.username);
-            });
-            this.form.assignees = ids;
+              ids.push(e.username)
+            })
+            this.form.assignees = ids
           }
         }
-      });
+      })
     },
     backTask(v) {
-      this.forminitial();
-      this.modalTaskTitle = "审批驳回";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.procDefId = v.procDefId;
-      this.form.priority = v.priority;
-      this.form.type = 1;
-      this.showAssign = false;
-      this.modalTaskVisible = true;
+      this.forminitial()
+      this.modalTaskTitle = '审批驳回'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.procDefId = v.procDefId
+      this.form.priority = v.priority
+      this.form.type = 1
+      this.showAssign = false
+      this.modalTaskVisible = true
       // 获取可驳回节点
       this.backList = [
         {
-          key: "-1",
-          name: "发起人"
+          key: '-1',
+          name: '发起人'
         }
-      ];
-      this.form.backTaskKey = "-1";
-      this.backLoading = true;
-      this.getAction(this.url.getBackList+v.procInstId).then(res => {
-        this.backLoading = false;
+      ]
+      this.form.backTaskKey = '-1'
+      this.backLoading = true
+      this.getAction(this.url.getBackList + v.procInstId).then(res => {
+        this.backLoading = false
         if (res.success) {
           res.result.forEach(e => {
-            this.backList.push(e);
-          });
+            this.backList.push(e)
+          })
         }
-      });
+      })
     },
     delegateTask(v) {
-      this.forminitial();
-      this.modalTaskTitle = "委托他人代办";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.type = 2;
-      this.showAssign = false;
-      this.modalTaskVisible = true;
+      this.forminitial()
+      this.modalTaskTitle = '委托他人代办'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.type = 2
+      this.showAssign = false
+      this.modalTaskVisible = true
     },
     history(v) {
       if (!v.procInstId) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.procInstId;
-      this.modalLsVisible = true;
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
     },
     passAll() {
       if (this.selectCount <= 0) {
-        this.$message.warning("您还未选择要通过的数据");
-        return;
+        this.$message.warning('您还未选择要通过的数据')
+        return
       }
       // 批量通过
-      this.modalVisible = true;
+      this.modalVisible = true
       this.$confirm({
-        title: "确认通过",
-        content:
-          "您确认要通过所选的 " +
-          this.selectCount +
-          " 条数据? 注意:将默认分配给节点设定的所有可审批用户",
+        title: '确认通过',
+        content: '您确认要通过所选的 ' + this.selectCount + ' 条数据? 注意:将默认分配给节点设定的所有可审批用户',
         loading: true,
         onOk: () => {
-          let ids = "";
+          let ids = ''
           this.selectList.forEach(function(e) {
-            ids += e.id + ",";
-          });
-          ids = ids.substring(0, ids.length - 1);
-          this.postFormAction(this.url.passAll,{ids:ids}).then(res => {
+            ids += e.id + ','
+          })
+          ids = ids.substring(0, ids.length - 1)
+          this.postFormAction(this.url.passAll, { ids: ids }).then(res => {
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalVisible = false;
-              this.clearSelectAll();
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalVisible = false
+              this.clearSelectAll()
+              this.getDataList()
             }
-          });
+          })
         }
-      });
+      })
     },
     backAll() {
       if (this.selectCount <= 0) {
-        this.$message.warning("您还未选择要驳回的数据");
-        return;
+        this.$message.warning('您还未选择要驳回的数据')
+        return
       }
       // 批量驳回
-      this.modalVisible = true;
+      this.modalVisible = true
       this.$confirm({
-        title: "确认驳回",
-        content:
-          "您确认要驳回所选的 " +
-          this.selectCount +
-          " 条数据? 注意:所有流程将驳回至发起人",
+        title: '确认驳回',
+        content: '您确认要驳回所选的 ' + this.selectCount + ' 条数据? 注意:所有流程将驳回至发起人',
         loading: true,
         onOk: () => {
-          let procInstIds = "";
+          let procInstIds = ''
           this.selectList.forEach(function(e) {
-            procInstIds += e.procInstId + ",";
-          });
-          procInstIds = procInstIds.substring(0, procInstIds.length - 1);
-          this.postFormAction(this.url.backAll,{procInstIds:procInstIds}).then(res => {
+            procInstIds += e.procInstId + ','
+          })
+          procInstIds = procInstIds.substring(0, procInstIds.length - 1)
+          this.postFormAction(this.url.backAll, { procInstIds: procInstIds }).then(res => {
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalVisible = false;
-              this.clearSelectAll();
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalVisible = false
+              this.clearSelectAll()
+              this.getDataList()
             }
-          });
+          })
         }
-      });
+      })
     }
-  },
-
-};
-</script>
+  }
+}
+</script>

+ 32 - 23
src/views/dashboard/MyToDo.vue

@@ -311,36 +311,30 @@ export default {
     this.getAnnList() //渲染公告(已发布的)
   },
   computed: {
-    //常用流程 按钮只显示 5个
-    //   activeKeyAll: function () {
-    //   return this.items.activeKeyAll(0, 2)
-    // },
-
     // 系统消息计算
     msgTotal() {
       return parseInt(this.msg1Count) + parseInt(this.msg2Count)
-    },
-    scroll: function() {
-      var width = window.innerWidth
-      // ant-table
-      let $antTable = window.document.getElementsByClassName('ant-table')
-      if ($antTable[0]) {
-        width = $antTable[0].clientWidth
-      }
-      return {
-        x: 1160,
-        y: window.innerHeight / 2
-      }
-    },
-    innerHeight: function() {
-      var innerHeight = window.innerHeight
-      return innerHeight
     }
+    // scroll: function() {
+    //   var width = window.innerWidth
+    //   // ant-table
+    //   let $antTable = window.document.getElementsByClassName('ant-table')
+    //   if ($antTable[0]) {
+    //     width = $antTable[0].clientWidth
+    //   }
+    //   return {
+    //     x: 1160,
+    //     y: window.innerHeight / 2
+    //   }
+    // },
+    // innerHeight: function() {
+    //   var innerHeight = window.innerHeight
+    //   return innerHeight
+    // }
   },
   mounted() {
     this.loadData()
     this.getAnnList()
-    // this.timer = setInterval(this.getCurrentTime, 1000) //时间
   },
   methods: {
     //获取当前时间
@@ -367,7 +361,22 @@ export default {
           let scrollData = [] //轮播表数据
           // 拿到返回的数据进行遍历并渲染
           this.annList.map(item => {
-            var list = [item.id, item.type, item.title, item.createBy, item.createTime]
+            //企业公告类型
+            var annType = ''
+            if (item.type == '人事') {
+              annType =
+                '<span style="color:purple;border:1px solid purple;padding:0 4px;border-radius:3px;background:#f9f0ff;">人事</span>'
+            }
+            if (item.type == '财务') {
+              annType =
+                '<span style="color:#13c2c5;border:1px solid #13c2c5;padding:0 4px;border-radius:3px;background:#e6fffb;">财务</span>'
+            }
+            if (item.type == '项目') {
+              annType =
+                '<span style="color:orange;border:1px solid orange;padding:0 4px;border-radius:3px;background:#fff7e6;">项目</span>'
+            }
+            var list = [item.id, annType, item.title, item.createBy, item.createTime]
+
             scrollData.push(list) //取到的每一个数据放到轮播表数据中
           })
           //轮播表配置

+ 13 - 6
src/views/dashboard/MyoaTabs.vue

@@ -43,7 +43,7 @@ export default {
     name: 'MyoaTabs',
     data () {
         return {
-            header: ['列1', '列2', '列3'],
+            // header: ['列1', '列2', '列3'],
             todoConfig: {},
             applyConfig: {},
             doneConfig: {},
@@ -60,7 +60,7 @@ export default {
         this.getDoneList()
     },
     methods: {
-    // 待办tbas
+    // 待办事项
         getTodoList () {
             this.postFormAction('/actTask/todoList', {}).then(res => {
                 if (res.success) {
@@ -69,6 +69,7 @@ export default {
                     let scrollData = [] // 轮播表数据
 
                     this.todoList.map(item => {
+                        // 优先级
                         var priorityCode = ''
                         if (item.priority == '0') {
                             priorityCode = '<span style="color:green;">普通</span>'
@@ -95,14 +96,14 @@ export default {
             })
         },
 
-        // 申请tbas
+        // 已发事项
         getApplyList () {
             getAction(this.url.list, {}).then(res => {
                 if (res.success) {
                     console.log('申请列表-->', res.result)
                     this.applyList = res.result
                     let scrollData = [] // 轮播表数据
-
+                    // 结果
                     this.applyList.map(item => {
                         var resultCode = ''
                         if (item.result == '0') {
@@ -134,7 +135,7 @@ export default {
             })
         },
 
-        // 已办tbas
+        // 已办事项
         getDoneList () {
             getAction(this.url.doneList, {}).then(res => {
                 if (res.success) {
@@ -142,6 +143,12 @@ export default {
                     this.doneList = res.result
                     let scrollData = [] // 轮播表数据
                     this.doneList.map(item => {
+                        // var relResult = ''
+                        // if (item.deleteReason == '审批通过') {
+                        //     relResult = <span style="color:green;">审批通过</span>
+                        // } else {
+                        //     relResult = <span style="color:orange;">审批不通过</span>
+                        // }
                         var list = [item.id, item.name, item.processName, item.applyer, item.deleteReason, item.createTime]
                         scrollData.push(list)
                     })
@@ -171,7 +178,7 @@ export default {
         },
         // 我的待办 tabs
         callback (key) {
-            console.log(key)
+            // console.log(key)
             if (key == '1') {
                 this.getTodoList()
             }

+ 159 - 159
src/views/jeecg/TableExpandeSub.vue

@@ -1,11 +1,9 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="24">
             <a-form-item label="订单号">
               <a-input placeholder="请输入订单号" v-model="queryParam.orderCode"></a-input>
@@ -26,7 +24,6 @@
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -38,12 +35,13 @@
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
+            <a-icon type="delete" />
             删除
           </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作
-          <a-icon type="down"/>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
         </a-button>
       </a-dropdown>
     </div>
@@ -51,7 +49,9 @@
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -62,15 +62,14 @@
         :columns="columns"
         :dataSource="dataSource"
         :pagination="false"
-        :expandedRowKeys= "expandedRowKeys"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        :expandedRowKeys="expandedRowKeys"
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
         @change="handleTableChange"
         @expand="handleExpand"
       >
-
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
-          <a-divider type="vertical"/>
+          <a-divider type="vertical" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
             <a>删除</a>
           </a-popconfirm>
@@ -85,7 +84,7 @@
           rowKey="id"
           :pagination="false"
           :loading="loading"
-          >
+        >
         </a-table>
       </a-table>
     </div>
@@ -97,170 +96,171 @@
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
-  import JeecgOrderDMainModal from '@/views/jeecg/tablist/form/JeecgOrderDMainModal'
-  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+import { getAction } from '@/api/manage'
+import JeecgOrderDMainModal from '@/views/jeecg/tablist/form/JeecgOrderDMainModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: "TableDemo",
+export default {
+    name: 'TableDemo',
     mixins: [JeecgListMixin],
     components: {
-      JeecgOrderDMainModal
+        JeecgOrderDMainModal
     },
-    data() {
-      return {
-        // 子表表头
-        innerColumns: [
-          {
-            title: '客户名',
-            align: "center",
-            width: 100,
-            dataIndex: 'name',
-            key: 'name',
-          },
-          {
-            title: '性别',
-            align: "center",
-            dataIndex: 'sex',
-            customRender: function (text) {
-              if (text == 1) {
-                return "男";
-              } else if (text == 2) {
-                return "女";
-              } else {
-                return text;
-              }
+    data () {
+        return {
+            // 子表表头
+            innerColumns: [
+                {
+                    title: '客户名',
+                    align: 'center',
+                    width: 100,
+                    dataIndex: 'name',
+                    key: 'name'
+                },
+                {
+                    title: '性别',
+                    align: 'center',
+                    dataIndex: 'sex',
+                    customRender: function (text) {
+                        if (text == 1) {
+                            return '男'
+                        } else if (text == 2) {
+                            return '女'
+                        } else {
+                            return text
+                        }
+                    }
+                },
+                {
+                    title: '身份证号码',
+                    align: 'center',
+                    dataIndex: 'idcard'
+                },
+                {
+                    title: '电话',
+                    dataIndex: 'telphone',
+                    align: 'center'
+                }
+            ],
+            innerData: [],
+            expandedRowKeys: [],
+            id: ' ',
+            description: '列表展开子表Demo',
+            // 列表表头
+            columns: [
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: 'center',
+                    customRender: function (t, r, index) {
+                        return parseInt(index) + 1
+                    }
+                },
+                {
+                    title: '订单号',
+                    align: 'center',
+                    dataIndex: 'orderCode'
+                },
+                {
+                    title: '订单类型',
+                    align: 'center',
+                    dataIndex: 'ctype',
+                    customRender: text => {
+                        let re = ''
+                        if (text === '1') {
+                            re = '国内订单'
+                        } else if (text === '2') {
+                            re = '国际订单'
+                        }
+                        return re
+                    }
+                },
+                {
+                    title: '订单日期',
+                    align: 'center',
+                    dataIndex: 'orderDate'
+                },
+                {
+                    title: '订单金额',
+                    align: 'center',
+                    dataIndex: 'orderMoney'
+                },
+                {
+                    title: '订单备注',
+                    align: 'center',
+                    dataIndex: 'content'
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    align: 'center',
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            // 分页参数
+            type: 'radio',
+            url: {
+                list: '/test/order/orderList',
+                delete: '/test/order/delete',
+                deleteBatch: '/test/order/deleteBatch',
+                customerListByMainId: '/test/order/listOrderCustomerByMainId'
             }
-          },
-          {
-            title: '身份证号码',
-            align: "center",
-            dataIndex: 'idcard',
-          },
-          {
-            title: '电话',
-            dataIndex: 'telphone',
-            align: "center",
-          },
-
-        ],
-        innerData: [],
-        expandedRowKeys: [],
-        id: ' ',
-        description: '列表展开子表Demo',
-        // 列表表头
-        columns: [{
-          title: '#',
-          dataIndex: '',
-          key: 'rowIndex',
-          width: 60,
-          align: "center",
-          customRender: function (t, r, index) {
-            return parseInt(index) + 1;
-          }
-        },
-          {
-            title: '订单号',
-            align: "center",
-            dataIndex: 'orderCode'
-          },
-          {
-            title: '订单类型',
-            align: "center",
-            dataIndex: 'ctype',
-            customRender: (text) => {
-              let re = "";
-              if (text === '1') {
-                re = "国内订单";
-              } else if (text === '2') {
-                re = "国际订单";
-              }
-              return re;
-            }
-          },
-          {
-            title: '订单日期',
-            align: "center",
-            dataIndex: 'orderDate'
-          },
-          {
-            title: '订单金额',
-            align: "center",
-            dataIndex: 'orderMoney'
-          },
-          {
-            title: '订单备注',
-            align: "center",
-            dataIndex: 'content'
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align: "center",
-            scopedSlots: {customRender: 'action'},
-          }],
-        // 分页参数
-        type: "radio",
-        url: {
-          list: "/test/order/orderList",
-          delete: "/test/order/delete",
-          deleteBatch: "/test/order/deleteBatch",
-          customerListByMainId: "/test/order/listOrderCustomerByMainId",
-        },
-      }
+        }
     },
     computed: {
-      currentId(){
-        return this.id;
-      }
+        currentId () {
+            return this.id
+        }
     },
     methods: {
-      handleExpand(expanded, record){
-        this.expandedRowKeys=[];
-        this.innerData=[];
-        if(expanded===true){
-          this.loading = true;
-          this.expandedRowKeys.push(record.id);
-          getAction(this.url.customerListByMainId, {mainId: record.id}).then((res) => {
-            if (res.success) {
-              this.loading = false;
-              this.innerData = res.result.records;
+        handleExpand (expanded, record) {
+            this.expandedRowKeys = []
+            this.innerData = []
+            if (expanded === true) {
+                this.loading = true
+                this.expandedRowKeys.push(record.id)
+                getAction(this.url.customerListByMainId, { mainId: record.id }).then(res => {
+                    if (res.success) {
+                        this.loading = false
+                        this.innerData = res.result.records
+                    }
+                })
             }
-          });
         }
-      },
     }
-  }
+}
 </script>
 <style scoped>
-  .ant-card-body .table-operator {
-    margin-bottom: 18px;
-  }
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
 
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
 
-  .anty-row-operator button {
-    margin: 0 5px
-  }
+.anty-row-operator button {
+  margin: 0 5px;
+}
 
-  .ant-btn-danger {
-    background-color: #ffffff
-  }
+.ant-btn-danger {
+  background-color: #ffffff;
+}
 
-  .ant-modal-cust-warp {
-    height: 100%
-  }
+.ant-modal-cust-warp {
+  height: 100%;
+}
 
-  .ant-modal-cust-warp .ant-modal-body {
-    height: calc(100% - 110px) !important;
-    overflow-y: auto
-  }
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
 
-  .ant-modal-cust-warp .ant-modal-content {
-    height: 90% !important;
-    overflow-y: hidden
-  }
-</style>
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+</style>

+ 268 - 269
src/views/modules/online/cgform/OnlCgformCopyList.vue

@@ -1,11 +1,9 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="表名">
               <a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
@@ -18,7 +16,6 @@
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -33,18 +30,20 @@
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
+            <a-icon type="delete" />
             删除
           </a-menu-item>
         </a-menu>
-        <a-button> 批量操作
-          <a-icon type="down"/>
+        <a-button>
+          批量操作
+          <a-icon type="down" />
         </a-button>
       </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
+      <!-- 选择 清空 -->
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i>
         已选择
@@ -52,7 +51,7 @@
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
-
+      <!-- 表 -->
       <a-table
         ref="table"
         size="middle"
@@ -62,16 +61,18 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        @change="handleTableChange"
+      >
         <template slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
-          <a-divider type="vertical"/>
+          <a-divider type="vertical" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多
-              <a-icon type="down"/>
+            <a
+              class="ant-dropdown-link"
+            >更多
+              <a-icon type="down" />
             </a>
             <a-menu slot="overlay">
               <a-menu-item>
@@ -85,16 +86,14 @@
               <a-menu-item>
                 <a @click="handleRemoveRecord(record.id)">移除</a>
               </a-menu-item>
-
             </a-menu>
           </a-dropdown>
         </template>
 
         <template slot="dbsync" slot-scope="text">
-          <span v-if="text==='Y'" style="color:limegreen">已同步</span>
-          <span v-if="text==='N'" style="color:red">未同步</span>
+          <span v-if="text === 'Y'" style="color:limegreen">已同步</span>
+          <span v-if="text === 'N'" style="color:red">未同步</span>
         </template>
-
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -103,13 +102,16 @@
     <onl-cgform-head-modal ref="modalForm" @ok="modalFormOk" :action-button="false"></onl-cgform-head-modal>
 
     <!-- 提示online报表链接 -->
-    <a-modal
-      :title="onlineUrlTitle"
-      :visible="onlineUrlVisible"
-      @cancel="handleOnlineUrlClose">
+    <a-modal :title="onlineUrlTitle" :visible="onlineUrlVisible" @cancel="handleOnlineUrlClose">
       <template slot="footer">
         <a-button @click="handleOnlineUrlClose">关闭</a-button>
-        <a-button type="primary" class="copy-this-text" :data-clipboard-text="onlineUrl" @click="onCopyUrl">复制</a-button>
+        <a-button
+          type="primary"
+          class="copy-this-text"
+          :data-clipboard-text="onlineUrl"
+          @click="onCopyUrl"
+        >复制</a-button
+        >
       </template>
       <p>{{ onlineUrl }}</p>
     </a-modal>
@@ -124,268 +126,265 @@
 </template>
 
 <script>
-  import { deleteAction, postAction,getAction } from '@/api/manage'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import Clipboard from 'clipboard'
-  import { filterObj } from '@/utils/util';
+import { deleteAction, postAction, getAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import Clipboard from 'clipboard'
+import { filterObj } from '@/utils/util'
 
-  export default {
+export default {
     name: 'OnlCgformHeadList',
     mixins: [JeecgListMixin],
-    components: {
-    },
-    data() {
-      return {
-        description: 'Online表单视图',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key: 'rowIndex',
-            width: 60,
-            align: 'center',
-            customRender: function(t, r, index) {
-              return parseInt(index) + 1
-            }
-          },
-
-          {
-            title: '视图表名',
-            align: 'center',
-            dataIndex: 'tableName'
-          },
-          {
-            title: '视图表描述',
-            align: 'center',
-            dataIndex: 'tableTxt'
-          },
-          {
-            title: '原表版本',
-            align: 'center',
-            dataIndex: 'tableVersion'
-          },
-          {
-            title: '视图版本',
-            align: 'center',
-            dataIndex: 'copyVersion'
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            scopedSlots: { customRender: 'action' }
-          }
-        ],
-        url: {
-          list: '/online/cgform/head/list',
-          delete: '/online/cgform/head/delete',
-          deleteBatch: '/online/cgform/head/deleteBatch',
-          removeRecord: '/online/cgform/head/removeRecord',
-        },
-        tableTypeDictOptions: [],
-        sexDictOptions: [],
-        syncModalVisible: false,
-        syncFormId: '',
-        synMethod: 'normal',
-        syncLoading: false,
-        onlineUrlTitle: '',
-        onlineUrlVisible: false,
-        onlineUrl: '',
-        selectedRowKeys: [],
-        selectedRows: [],
-        physicId:""
-      }
+    components: {},
+    data () {
+        return {
+            description: 'Online表单视图',
+            // 表头
+            columns: [
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: 'center',
+                    customRender: function (t, r, index) {
+                        return parseInt(index) + 1
+                    }
+                },
+
+                {
+                    title: '视图表名',
+                    align: 'center',
+                    dataIndex: 'tableName'
+                },
+                {
+                    title: '视图表描述',
+                    align: 'center',
+                    dataIndex: 'tableTxt'
+                },
+                {
+                    title: '原表版本',
+                    align: 'center',
+                    dataIndex: 'tableVersion'
+                },
+                {
+                    title: '视图版本',
+                    align: 'center',
+                    dataIndex: 'copyVersion'
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    align: 'center',
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            url: {
+                list: '/online/cgform/head/list',
+                delete: '/online/cgform/head/delete',
+                deleteBatch: '/online/cgform/head/deleteBatch',
+                removeRecord: '/online/cgform/head/removeRecord'
+            },
+            tableTypeDictOptions: [],
+            sexDictOptions: [],
+            syncModalVisible: false,
+            syncFormId: '',
+            synMethod: 'normal',
+            syncLoading: false,
+            onlineUrlTitle: '',
+            onlineUrlVisible: false,
+            onlineUrl: '',
+            selectedRowKeys: [],
+            selectedRows: [],
+            physicId: ''
+        }
     },
     watch: {
-      '$route'() {
-        this.loadData()
-      }
+        $route () {
+            this.loadData()
+        }
     },
     methods: {
-      getQueryParams() {
-        //获取查询条件
-        var param = Object.assign({}, this.queryParam, this.isorter ,this.filters);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        param.copyType = 1;
-        param.physicId = this.physicId;
-        return filterObj(param);
-      },
+        getQueryParams () {
+            // 获取查询条件
+            var param = Object.assign({}, this.queryParam, this.isorter, this.filters)
+            param.field = this.getQueryField()
+            param.pageNo = this.ipagination.current
+            param.pageSize = this.ipagination.pageSize
+            param.copyType = 1
+            param.physicId = this.physicId
+            return filterObj(param)
+        },
 
-      loadData(arg) {
-        if(!this.$route.params.code){
-          return false
-        }
-        this.physicId = this.$route.params.code
-        if(!this.url.list){
-          this.$message.error("请设置url.list属性!")
-          return
-        }
-        //加载数据 若传入参数1则加载第一页的内容
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        var params = this.getQueryParams();//查询条件
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            this.dataSource = res.result.records;
-            this.ipagination.total = res.result.total;
-          }
-          if(res.code===510){
-            this.$message.warning(res.message)
-          }
-          this.loading = false;
-        })
-      },
+        loadData (arg) {
+            if (!this.$route.params.code) {
+                return false
+            }
+            this.physicId = this.$route.params.code
+            if (!this.url.list) {
+                this.$message.error('请设置url.list属性!')
+                return
+            }
+            // 加载数据 若传入参数1则加载第一页的内容
+            if (arg === 1) {
+                this.ipagination.current = 1
+            }
+            var params = this.getQueryParams() // 查询条件
+            this.loading = true
+            getAction(this.url.list, params).then(res => {
+                if (res.success) {
+                    this.dataSource = res.result.records
+                    this.ipagination.total = res.result.total
+                }
+                if (res.code === 510) {
+                    this.$message.warning(res.message)
+                }
+                this.loading = false
+            })
+        },
 
-      goPageOnline(rd) {
-        if(rd.isTree=='Y'){
-          this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
-        }else{
-          this.$router.push({ path: '/online/cgformList/' + rd.id })
-        }
-      },
-      handleOnlineUrlClose() {
-        this.onlineUrlTitle = ''
-        this.onlineUrlVisible = false
-      },
-      handleOnlineUrlShow(record) {
-        if(record.isTree=='Y'){
-          this.onlineUrl = `/online/cgformTreeList/${record.id}`
-        }else{
-          this.onlineUrl = `/online/cgformList/${record.id}`
-        }
-        this.onlineUrlVisible = true
-        this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
-      },
-      handleRemoveRecord(id) {
-        let that = this
-        this.$confirm({
-          title: '确认要移除此记录?',
-          onOk() {
-            deleteAction(that.url.removeRecord, { id: id }).then((res) => {
-              if (res.success) {
-                that.$message.success('移除成功')
-                that.loadData()
-              } else {
-                that.$message.warning(res.message)
-              }
+        goPageOnline (rd) {
+            if (rd.isTree == 'Y') {
+                this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
+            } else {
+                this.$router.push({ path: '/online/cgformList/' + rd.id })
+            }
+        },
+        handleOnlineUrlClose () {
+            this.onlineUrlTitle = ''
+            this.onlineUrlVisible = false
+        },
+        handleOnlineUrlShow (record) {
+            if (record.isTree == 'Y') {
+                this.onlineUrl = `/online/cgformTreeList/${record.id}`
+            } else {
+                this.onlineUrl = `/online/cgformList/${record.id}`
+            }
+            this.onlineUrlVisible = true
+            this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
+        },
+        handleRemoveRecord (id) {
+            let that = this
+            this.$confirm({
+                title: '确认要移除此记录?',
+                onOk () {
+                    deleteAction(that.url.removeRecord, { id: id }).then(res => {
+                        if (res.success) {
+                            that.$message.success('移除成功')
+                            that.loadData()
+                        } else {
+                            that.$message.warning(res.message)
+                        }
+                    })
+                },
+                onCancel () {}
             })
-          },
-          onCancel() {
-          }
-        })
-      },
-      doEnhanceJs() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehjs.show(this.selectedRowKeys[0])
-      },
-      doEnhanceSql() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehsql.show(this.selectedRowKeys[0])
-      },
-      doEnhanceJava() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehjava.show(this.selectedRowKeys[0])
-      },
-      doCgformButton() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.btnList.show(this.selectedRowKeys[0])
+        },
+        doEnhanceJs () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehjs.show(this.selectedRowKeys[0])
+        },
+        doEnhanceSql () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehsql.show(this.selectedRowKeys[0])
+        },
+        doEnhanceJava () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehjava.show(this.selectedRowKeys[0])
+        },
+        doCgformButton () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.btnList.show(this.selectedRowKeys[0])
 
-        //this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
-      },
-      importOnlineForm() {
-        this.$refs.transd2o.show()
-      },
-      transOk() {
-        this.loadData()
-      },
-      onSelectChange(keys, rows) {
-        this.selectedRowKeys = keys
-        this.selectedRows = rows
-      },
-      onCopyUrl(){
-        var clipboard = new Clipboard('.copy-this-text')
-        clipboard.on('success', () => {
-          clipboard.destroy()
-          this.$message.success('复制成功')
-          this.handleOnlineUrlClose()
-        })
-        clipboard.on('error', () => {
-          this.$message.error('该浏览器不支持自动复制')
-          clipboard.destroy()
-        })
-      },
-      showMyCopyInfo(id){
-        console.log("查看复制表单的信息",id)
-      },
-      copyConfig(id){
-        postAction(`${this.url.copyOnline}?code=${id}`).then(res=>{
-          if(res.success){
-            this.$message.success("复制成功")
+            // this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
+        },
+        importOnlineForm () {
+            this.$refs.transd2o.show()
+        },
+        transOk () {
             this.loadData()
-          }else{
-            this.$message.error("复制失败>>"+res.message)
-          }
-        })
-      }
-
+        },
+        onSelectChange (keys, rows) {
+            this.selectedRowKeys = keys
+            this.selectedRows = rows
+        },
+        onCopyUrl () {
+            var clipboard = new Clipboard('.copy-this-text')
+            clipboard.on('success', () => {
+                clipboard.destroy()
+                this.$message.success('复制成功')
+                this.handleOnlineUrlClose()
+            })
+            clipboard.on('error', () => {
+                this.$message.error('该浏览器不支持自动复制')
+                clipboard.destroy()
+            })
+        },
+        showMyCopyInfo (id) {
+            console.log('查看复制表单的信息', id)
+        },
+        copyConfig (id) {
+            postAction(`${this.url.copyOnline}?code=${id}`).then(res => {
+                if (res.success) {
+                    this.$message.success('复制成功')
+                    this.loadData()
+                } else {
+                    this.$message.error('复制失败>>' + res.message)
+                }
+            })
+        }
     }
-  }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <style lang="less">
-  .ant-card-body .table-operator {
-    margin-bottom: 18px;
-  }
-
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
-
-  .anty-row-operator button {
-    margin: 0 5px
-  }
-
-  .ant-btn-danger {
-    background-color: #ffffff
-  }
-
-  .ant-modal-cust-warp {
-    height: 100%
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+
+.anty-row-operator button {
+  margin: 0 5px;
+}
+
+.ant-btn-danger {
+  background-color: #ffffff;
+}
+
+.ant-modal-cust-warp {
+  height: 100%;
+}
+
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+
+.valid-error-cust {
+  .ant-select-selection {
+    border: 2px solid #f5222d;
   }
-
-  .ant-modal-cust-warp .ant-modal-body {
-    height: calc(100% - 110px) !important;
-    overflow-y: auto
-  }
-
-  .ant-modal-cust-warp .ant-modal-content {
-    height: 90% !important;
-    overflow-y: hidden
-  }
-
-  .valid-error-cust{
-    .ant-select-selection{
-      border:2px solid #f5222d;
-    }
-  }
-</style>
+}
+</style>

+ 322 - 332
src/views/modules/online/cgform/OnlCgformHeadList.vue

@@ -1,11 +1,9 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="表名">
               <a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
@@ -13,7 +11,7 @@
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="表类型">
-              <j-dict-select-tag dictCode="cgform_table_type" v-model="queryParam.tableType"/>
+              <j-dict-select-tag dictCode="cgform_table_type" v-model="queryParam.tableType" />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -27,7 +25,6 @@
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -42,26 +39,20 @@
       <a-button @click="importOnlineForm" type="primary" icon="database">从数据库导入表单</a-button>
       <a-button @click="goGenerateCode" type="primary" icon="database">代码生成</a-button>
 
+      <!-- 批量操作 -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
-            删除
-          </a-menu-item>
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
         </a-menu>
-        <a-button> 批量操作
-          <a-icon type="down"/>
-        </a-button>
+        <a-button>批量操作<a-icon type="down" /></a-button>
       </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i>
-        已选择
-        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
-        项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -74,23 +65,22 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        @change="handleTableChange"
+      >
         <template slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
-          <a-divider type="vertical"/>
+          <a-divider type="vertical" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多
-              <a-icon type="down"/>
-            </a>
+            <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
+            <!--  -->
             <a-menu slot="overlay">
-              <a-menu-item v-if="record.isDbSynch!='Y'">
+              <a-menu-item v-if="record.isDbSynch != 'Y'">
                 <a @click="openSyncModal(record.id)">同步数据库</a>
               </a-menu-item>
 
-              <template v-if="record.isDbSynch=='Y' && record.tableType !== 3">
+              <template v-if="record.isDbSynch == 'Y' && record.tableType !== 3">
                 <a-menu-item>
                   <a @click="goPageOnline(record)">功能测试</a>
                 </a-menu-item>
@@ -103,7 +93,7 @@
                 <a @click="copyConfig(record.id)">复制视图</a>
               </a-menu-item>
 
-              <a-menu-item v-if="record.hascopy==1">
+              <a-menu-item v-if="record.hascopy == 1">
                 <a @click="showMyCopyInfo(record.id)">配置视图</a>
               </a-menu-item>
 
@@ -116,16 +106,14 @@
                   <a>删除</a>
                 </a-popconfirm>
               </a-menu-item>
-
             </a-menu>
           </a-dropdown>
         </template>
 
         <template slot="dbsync" slot-scope="text">
-          <span v-if="text==='Y'" style="color:limegreen">已同步</span>
-          <span v-if="text==='N'" style="color:red">未同步</span>
+          <a-tag v-if="text === 'Y'" color="green">已同步</a-tag>
+          <a-tag v-if="text === 'N'" color="red">未同步</a-tag>
         </template>
-
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -140,7 +128,8 @@
       title="同步数据库"
       :visible="syncModalVisible"
       @cancel="handleCancleDbSync"
-      style="top:5%;height: 95%;">
+      style="top:5%;height: 95%;"
+    >
       <template slot="footer">
         <a-button @click="handleCancleDbSync">关闭</a-button>
         <a-button type="primary" :loading="syncLoading" @click="handleDbSync">
@@ -154,13 +143,16 @@
     </a-modal>
 
     <!-- 提示online报表链接 -->
-    <a-modal
-      :title="onlineUrlTitle"
-      :visible="onlineUrlVisible"
-      @cancel="handleOnlineUrlClose">
+    <a-modal :title="onlineUrlTitle" :visible="onlineUrlVisible" @cancel="handleOnlineUrlClose">
       <template slot="footer">
         <a-button @click="handleOnlineUrlClose">关闭</a-button>
-        <a-button type="primary" class="copy-this-text" :data-clipboard-text="onlineUrl" @click="onCopyUrl">复制</a-button>
+        <a-button
+          type="primary"
+          class="copy-this-text"
+          :data-clipboard-text="onlineUrl"
+          @click="onCopyUrl"
+        >复制</a-button
+        >
       </template>
       <p>{{ onlineUrl }}</p>
     </a-modal>
@@ -176,318 +168,316 @@
 </template>
 
 <script>
-  import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
-  import { deleteAction, postAction } from '@/api/manage'
-  import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import Clipboard from 'clipboard'
-  import { filterObj } from '@/utils/util';
-
-  export default {
+import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
+import { deleteAction, postAction } from '@/api/manage'
+import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import Clipboard from 'clipboard'
+import { filterObj } from '@/utils/util'
+
+export default {
     name: 'OnlCgformHeadList',
     mixins: [JeecgListMixin],
     components: {
-      JDictSelectTag,
-    },
-    data() {
-      return {
-        description: 'Online表单开发管理页面',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key: 'rowIndex',
-            width: 60,
-            align: 'center',
-            customRender: function(t, r, index) {
-              return parseInt(index) + 1
-            }
-          },
-          {
-            title: '表类型',
-            align: 'center',
-            dataIndex: 'tableType',
-            customRender: (text, record) => {
-              let tbTypeText = filterDictText(this.tableTypeDictOptions, `${text}`)
-              if(record.isTree === 'Y'){
-                tbTypeText+='(树)'
-              }
-              return tbTypeText;
-            }
-          },
-          {
-            title: '表名',
-            align: 'center',
-            dataIndex: 'tableName'
-          },
-          {
-            title: '表描述',
-            align: 'center',
-            dataIndex: 'tableTxt'
-          },
-          {
-            title: '版本',
-            align: 'center',
-            dataIndex: 'tableVersion'
-          },
-
-          {
-            title: '同步数据库状态',
-            align: 'center',
-            dataIndex: 'isDbSynch',
-            scopedSlots: { customRender: 'dbsync' }
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            scopedSlots: { customRender: 'action' }
-          }
-        ],
-        url: {
-          list: '/online/cgform/head/list',
-          delete: '/online/cgform/head/delete',
-          deleteBatch: '/online/cgform/head/deleteBatch',
-          doDbSynch: '/online/cgform/api/doDbSynch/',
-          removeRecord: '/online/cgform/head/removeRecord',
-          copyOnline: '/online/cgform/head/copyOnline'
-        },
-        tableTypeDictOptions: [],
-        sexDictOptions: [],
-        syncModalVisible: false,
-        syncFormId: '',
-        synMethod: 'normal',
-        syncLoading: false,
-        onlineUrlTitle: '',
-        onlineUrlVisible: false,
-        onlineUrl: '',
-        selectedRowKeys: [],
-        selectedRows: []
-      }
+        JDictSelectTag
     },
-    created() {
-      //初始化字典 - 表类型
-      initDictOptions('cgform_table_type').then((res) => {
-        if (res.success) {
-          this.tableTypeDictOptions = res.result
+    data () {
+        return {
+            description: 'Online表单开发管理页面',
+            // 表头
+            columns: [
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: 'center',
+                    customRender: function (t, r, index) {
+                        return parseInt(index) + 1
+                    }
+                },
+                {
+                    title: '表类型',
+                    align: 'center',
+                    dataIndex: 'tableType',
+                    customRender: (text, record) => {
+                        let tbTypeText = filterDictText(this.tableTypeDictOptions, `${text}`)
+                        if (record.isTree === 'Y') {
+                            tbTypeText += '(树)'
+                        }
+                        return tbTypeText
+                    }
+                },
+                {
+                    title: '表名',
+                    align: 'center',
+                    dataIndex: 'tableName'
+                },
+                {
+                    title: '表描述',
+                    align: 'center',
+                    dataIndex: 'tableTxt'
+                },
+                {
+                    title: '版本',
+                    align: 'center',
+                    dataIndex: 'tableVersion'
+                },
+
+                {
+                    title: '同步数据库状态',
+                    align: 'center',
+                    dataIndex: 'isDbSynch',
+                    scopedSlots: { customRender: 'dbsync' }
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    align: 'center',
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            url: {
+                list: '/online/cgform/head/list',
+                delete: '/online/cgform/head/delete',
+                deleteBatch: '/online/cgform/head/deleteBatch',
+                doDbSynch: '/online/cgform/api/doDbSynch/',
+                removeRecord: '/online/cgform/head/removeRecord',
+                copyOnline: '/online/cgform/head/copyOnline'
+            },
+            tableTypeDictOptions: [],
+            sexDictOptions: [],
+            syncModalVisible: false,
+            syncFormId: '',
+            synMethod: 'normal',
+            syncLoading: false,
+            onlineUrlTitle: '',
+            onlineUrlVisible: false,
+            onlineUrl: '',
+            selectedRowKeys: [],
+            selectedRows: []
         }
-      })
     },
-    methods: {
-      doDbSynch(id) {
-        postAction(this.url.doDbSynch + id, { synMethod: '1' }).then((res) => {
-          if (res.success) {
-            this.$message.success(res.message)
-            this.loadData()
-          } else {
-            this.$message.warning(res.message)
-          }
-        })
-      },
-      getQueryParams() {
-        //获取查询条件
-        var param = Object.assign({}, this.queryParam, this.isorter ,this.filters);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        param.copyType = 0;
-        return filterObj(param);
-      },
-      handleCancleDbSync() {
-        this.syncModalVisible = false
-      },
-      handleDbSync() {
-        this.syncLoading = true
-        postAction(this.url.doDbSynch + this.syncFormId + '/' + this.synMethod).then((res) => {
-          this.syncModalVisible = false
-          this.syncLoading = false
-          if (res.success) {
-            this.$message.success(res.message)
-            this.loadData()
-          } else {
-            this.$message.warning(res.message)
-          }
+    created () {
+    // 初始化字典 - 表类型
+        initDictOptions('cgform_table_type').then(res => {
+            if (res.success) {
+                this.tableTypeDictOptions = res.result
+            }
         })
-        setTimeout(()=>{
-          if(this.syncLoading){
+    },
+    methods: {
+        doDbSynch (id) {
+            postAction(this.url.doDbSynch + id, { synMethod: '1' }).then(res => {
+                if (res.success) {
+                    this.$message.success(res.message)
+                    this.loadData()
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+        },
+        getQueryParams () {
+            // 获取查询条件
+            var param = Object.assign({}, this.queryParam, this.isorter, this.filters)
+            param.field = this.getQueryField()
+            param.pageNo = this.ipagination.current
+            param.pageSize = this.ipagination.pageSize
+            param.copyType = 0
+            return filterObj(param)
+        },
+        handleCancleDbSync () {
             this.syncModalVisible = false
+        },
+        handleDbSync () {
+            this.syncLoading = true
+            postAction(this.url.doDbSynch + this.syncFormId + '/' + this.synMethod).then(res => {
+                this.syncModalVisible = false
+                this.syncLoading = false
+                if (res.success) {
+                    this.$message.success(res.message)
+                    this.loadData()
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+            setTimeout(() => {
+                if (this.syncLoading) {
+                    this.syncModalVisible = false
+                    this.syncLoading = false
+                    this.$message.success('网络延迟,已自动刷新!')
+                    this.loadData()
+                }
+            }, 10000)
+        },
+        openSyncModal (id) {
+            this.syncModalVisible = true
             this.syncLoading = false
-            this.$message.success("网络延迟,已自动刷新!")
-            this.loadData()
-          }
-        },10000)
-      },
-      openSyncModal(id) {
-        this.syncModalVisible = true
-        this.syncLoading = false
-        this.syncFormId = id
-      },
-      goPageOnline(rd) {
-        if(rd.themeTemplate === 'erp'){
-          this.$router.push({ path: '/online/cgformErpList/' + rd.id })
-        }else{
-          if(rd.isTree=='Y'){
-            this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
-          }else{
-            this.$router.push({ path: '/online/cgformList/' + rd.id })
-          }
-        }
-      },
-      handleOnlineUrlClose() {
-        this.onlineUrlTitle = ''
-        this.onlineUrlVisible = false
-      },
-      handleOnlineUrlShow(record) {
-        if(record.isTree=='Y'){
-          this.onlineUrl = `/online/cgformTreeList/${record.id}`
-        }else{
-          this.onlineUrl = `/online/cgformList/${record.id}`
-        }
-        this.onlineUrlVisible = true
-        this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
-      },
-      handleRemoveRecord(id) {
-        let that = this
-        this.$confirm({
-          title: '确认要移除此记录?',
-          onOk() {
-            deleteAction(that.url.removeRecord, { id: id }).then((res) => {
-              if (res.success) {
-                that.$message.success('移除成功')
-                that.loadData()
-              } else {
-                that.$message.warning(res.message)
-              }
+            this.syncFormId = id
+        },
+        goPageOnline (rd) {
+            if (rd.themeTemplate === 'erp') {
+                this.$router.push({ path: '/online/cgformErpList/' + rd.id })
+            } else {
+                if (rd.isTree == 'Y') {
+                    this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
+                } else {
+                    this.$router.push({ path: '/online/cgformList/' + rd.id })
+                }
+            }
+        },
+        handleOnlineUrlClose () {
+            this.onlineUrlTitle = ''
+            this.onlineUrlVisible = false
+        },
+        handleOnlineUrlShow (record) {
+            if (record.isTree == 'Y') {
+                this.onlineUrl = `/online/cgformTreeList/${record.id}`
+            } else {
+                this.onlineUrl = `/online/cgformList/${record.id}`
+            }
+            this.onlineUrlVisible = true
+            this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
+        },
+        handleRemoveRecord (id) {
+            let that = this
+            this.$confirm({
+                title: '确认要移除此记录?',
+                onOk () {
+                    deleteAction(that.url.removeRecord, { id: id }).then(res => {
+                        if (res.success) {
+                            that.$message.success('移除成功')
+                            that.loadData()
+                        } else {
+                            that.$message.warning(res.message)
+                        }
+                    })
+                },
+                onCancel () {}
             })
-          },
-          onCancel() {
-          }
-        })
-      },
-      doEnhanceJs() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehjs.show(this.selectedRowKeys[0])
-      },
-      doEnhanceSql() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehsql.show(this.selectedRowKeys[0])
-      },
-      doEnhanceJava() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.ehjava.show(this.selectedRowKeys[0])
-      },
-      doCgformButton() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        this.$refs.btnList.show(this.selectedRowKeys[0])
+        },
+        doEnhanceJs () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehjs.show(this.selectedRowKeys[0])
+        },
+        doEnhanceSql () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehsql.show(this.selectedRowKeys[0])
+        },
+        doEnhanceJava () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.ehjava.show(this.selectedRowKeys[0])
+        },
+        doCgformButton () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            this.$refs.btnList.show(this.selectedRowKeys[0])
 
-        //this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
-      },
-      importOnlineForm() {
-        this.$refs.transd2o.show()
-      },
-      transOk() {
-        this.loadData()
-      },
-      goGenerateCode() {
-        if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
-          this.$message.warning('请先选中一条记录')
-          return
-        }
-        let row = this.selectedRows[0]
-        if (!row.isDbSynch || row.isDbSynch == 'N') {
-          this.$message.warning('请先同步数据库!')
-          return
-        }
-        if (row.tableType == 3) {
-          this.$message.warning('请选中该表对应的主表生成代码')
-          return
-        }
-        this.$refs.cg.show(this.selectedRowKeys[0])
-      },
-      onSelectChange(keys, rows) {
-        this.selectedRowKeys = keys
-        this.selectedRows = rows
-      },
-      onCopyUrl(){
-        var clipboard = new Clipboard('.copy-this-text')
-        clipboard.on('success', () => {
-          clipboard.destroy()
-          this.$message.success('复制成功')
-          this.handleOnlineUrlClose()
-        })
-        clipboard.on('error', () => {
-          this.$message.error('该浏览器不支持自动复制')
-          clipboard.destroy()
-        })
-      },
-      showMyCopyInfo(id){
-        this.$router.push({ path: '/online/copyform/' + id })
-      },
-      copyConfig(id){
-        postAction(`${this.url.copyOnline}?code=${id}`).then(res=>{
-          if(res.success){
-            this.$message.success("复制成功")
+            // this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
+        },
+        importOnlineForm () {
+            this.$refs.transd2o.show()
+        },
+        transOk () {
             this.loadData()
-          }else{
-            this.$message.error("复制失败>>"+res.message)
-          }
-        })
-      }
-
+        },
+        goGenerateCode () {
+            if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
+                this.$message.warning('请先选中一条记录')
+                return
+            }
+            let row = this.selectedRows[0]
+            if (!row.isDbSynch || row.isDbSynch == 'N') {
+                this.$message.warning('请先同步数据库!')
+                return
+            }
+            if (row.tableType == 3) {
+                this.$message.warning('请选中该表对应的主表生成代码')
+                return
+            }
+            this.$refs.cg.show(this.selectedRowKeys[0])
+        },
+        onSelectChange (keys, rows) {
+            this.selectedRowKeys = keys
+            this.selectedRows = rows
+        },
+        onCopyUrl () {
+            var clipboard = new Clipboard('.copy-this-text')
+            clipboard.on('success', () => {
+                clipboard.destroy()
+                this.$message.success('复制成功')
+                this.handleOnlineUrlClose()
+            })
+            clipboard.on('error', () => {
+                this.$message.error('该浏览器不支持自动复制')
+                clipboard.destroy()
+            })
+        },
+        showMyCopyInfo (id) {
+            this.$router.push({ path: '/online/copyform/' + id })
+        },
+        copyConfig (id) {
+            postAction(`${this.url.copyOnline}?code=${id}`).then(res => {
+                if (res.success) {
+                    this.$message.success('复制成功')
+                    this.loadData()
+                } else {
+                    this.$message.error('复制失败>>' + res.message)
+                }
+            })
+        }
     }
-  }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <style lang="less">
-  .ant-card-body .table-operator {
-    margin-bottom: 18px;
-  }
-
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
-
-  .anty-row-operator button {
-    margin: 0 5px
-  }
-
-  .ant-btn-danger {
-    background-color: #ffffff
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+
+.anty-row-operator button {
+  margin: 0 5px;
+}
+
+.ant-btn-danger {
+  background-color: #ffffff;
+}
+
+.ant-modal-cust-warp {
+  height: 100%;
+}
+
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+
+.valid-error-cust {
+  .ant-select-selection {
+    border: 2px solid #f5222d;
   }
-
-  .ant-modal-cust-warp {
-    height: 100%
-  }
-
-  .ant-modal-cust-warp .ant-modal-body {
-    height: calc(100% - 110px) !important;
-    overflow-y: auto
-  }
-
-  .ant-modal-cust-warp .ant-modal-content {
-    height: 90% !important;
-    overflow-y: hidden
-  }
-
-  .valid-error-cust{
-    .ant-select-selection{
-      border:2px solid #f5222d;
-    }
-  }
-</style>
+}
+</style>

+ 682 - 638
src/views/modules/online/cgform/auto/OnlCgformAutoList.vue

@@ -2,22 +2,44 @@
   <a-card :bordered="false" style="height: 100%">
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchByquery">
-        <a-row :gutter="24" v-if="queryInfo && queryInfo.length>0">
-          <template v-for="(item,index) in queryInfo">
-            <template v-if=" item.hidden==='1' ">
-              <a-col v-if="item.view=='datetime'" :md="12" :sm="16" :key=" 'query'+index " v-show="toggleSearchStatus">
-                <online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
+        <a-row :gutter="24" v-if="queryInfo && queryInfo.length > 0">
+          <template v-for="(item, index) in queryInfo">
+            <template v-if="item.hidden === '1'">
+              <a-col
+                v-if="item.view == 'datetime'"
+                :md="12"
+                :sm="16"
+                :key="'query' + index"
+                v-show="toggleSearchStatus"
+              >
+                <online-query-form-item
+                  :queryParam="queryParam"
+                  :item="item"
+                  :dictOptions="dictOptions"
+                ></online-query-form-item>
               </a-col>
-              <a-col v-else :md="6" :sm="8" :key=" 'query'+index " v-show="toggleSearchStatus">
-                <online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
+              <a-col v-else :md="6" :sm="8" :key="'query' + index" v-show="toggleSearchStatus">
+                <online-query-form-item
+                  :queryParam="queryParam"
+                  :item="item"
+                  :dictOptions="dictOptions"
+                ></online-query-form-item>
               </a-col>
             </template>
             <template v-else>
-              <a-col v-if="item.view=='datetime'" :md="12" :sm="16" :key=" 'query'+index ">
-                <online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
+              <a-col v-if="item.view == 'datetime'" :md="12" :sm="16" :key="'query' + index">
+                <online-query-form-item
+                  :queryParam="queryParam"
+                  :item="item"
+                  :dictOptions="dictOptions"
+                ></online-query-form-item>
               </a-col>
-              <a-col v-else :md="6" :sm="8" :key=" 'query'+index ">
-                <online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
+              <a-col v-else :md="6" :sm="8" :key="'query' + index">
+                <online-query-form-item
+                  :queryParam="queryParam"
+                  :item="item"
+                  :dictOptions="dictOptions"
+                ></online-query-form-item>
               </a-col>
             </template>
           </template>
@@ -28,11 +50,10 @@
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
               <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
               </a>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -42,21 +63,23 @@
       <a-button v-if="buttonSwitch.add" @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button v-if="buttonSwitch.import" @click="handleImportXls" type="primary" icon="upload">导入</a-button>
       <a-button v-if="buttonSwitch.export" @click="handleExportXls" type="primary" icon="download">导出</a-button>
-      <template v-if="cgButtonList && cgButtonList.length>0" v-for="(item,index) in cgButtonList">
+      <template v-if="cgButtonList && cgButtonList.length > 0" v-for="(item, index) in cgButtonList">
         <a-button
-          v-if=" item.optType=='js' "
-          :key=" 'cgbtn'+index "
+          v-if="item.optType == 'js'"
+          :key="'cgbtn' + index"
           @click="cgButtonJsHandler(item.buttonCode)"
           type="primary"
-          :icon="item.buttonIcon">
+          :icon="item.buttonIcon"
+        >
           {{ item.buttonName }}
         </a-button>
         <a-button
-          v-else-if=" item.optType=='action' "
-          :key=" 'cgbtn'+index "
+          v-else-if="item.optType == 'action'"
+          :key="'cgbtn' + index"
           @click="cgButtonActionHandler(item.buttonCode)"
           type="primary"
-          :icon="item.buttonIcon">
+          :icon="item.buttonIcon"
+        >
           {{ item.buttonName }}
         </a-button>
       </template>
@@ -67,7 +90,8 @@
         :fieldList="superQuery.fieldList"
         :saveCode="$route.fullPath"
         :loading="table.loading"
-        @handleSuperQuery="handleSuperQuery"/>
+        @handleSuperQuery="handleSuperQuery"
+      />
 
       <a-button
         v-if="buttonSwitch.batch_delete"
@@ -75,13 +99,16 @@
         v-show="table.selectedRowKeys.length > 0"
         ghost
         type="primary"
-        icon="delete">批量删除</a-button>
+        icon="delete"
+      >批量删除</a-button
+      >
     </div>
 
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i>
-        已选择&nbsp;<a style="font-weight: 600">{{ table.selectedRowKeys.length }}</a>项&nbsp;&nbsp;
+        已选择&nbsp;<a style="font-weight: 600">{{ table.selectedRowKeys.length }}</a
+        >项&nbsp;&nbsp;
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -97,18 +124,13 @@
         :rowSelection="rowSelectionConfig"
         @change="handleTableChange"
         :scroll="table.scroll"
-        style="min-height: 300px">
-
+        style="min-height: 300px"
+      >
         <!-- 支持链接href跳转 -->
-        <template
-          v-for="field of fieldHrefSlots"
-          :slot="field.slotName"
-          slot-scope="text, record"
-        >
-          <a @click="handleClickFieldHref(field,record)">{{ text }}</a>
+        <template v-for="field of fieldHrefSlots" :slot="field.slotName" slot-scope="text, record">
+          <a @click="handleClickFieldHref(field, record)">{{ text }}</a>
         </template>
 
-
         <template slot="dateSlot" slot-scope="text">
           <span>{{ getFormatDate(text) }}</span>
         </template>
@@ -119,7 +141,13 @@
 
         <template slot="imgSlot" slot-scope="text">
           <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
-          <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+          <img
+            v-else
+            :src="getImgView(text)"
+            height="25px"
+            alt="图片不存在"
+            style="max-width:80px;font-size: 12px;font-style: italic;"
+          />
         </template>
 
         <template slot="fileSlot" slot-scope="text">
@@ -137,34 +165,32 @@
 
         <span slot="action" slot-scope="text, record">
           <template v-if="hasBpmStatus">
-            <template v-if="record.bpm_status == '1'||record.bpm_status == ''|| record.bpm_status == null">
+            <template v-if="record.bpm_status == '1' || record.bpm_status == '' || record.bpm_status == null">
               <template v-if="buttonSwitch.update">
-              <a @click="handleEdit(record)">编辑</a>
-              <a-divider type="vertical"/>
-            </template>
+                <a @click="handleEdit(record)">编辑</a>
+                <a-divider type="vertical" />
+              </template>
             </template>
           </template>
           <template v-else>
             <template v-if="buttonSwitch.update">
               <a @click="handleEdit(record)">编辑</a>
-              <a-divider type="vertical"/>
+              <a-divider type="vertical" />
             </template>
           </template>
           <a-dropdown>
-            <a class="ant-dropdown-link">
-              更多 <a-icon type="down" />
-            </a>
+            <a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
             <a-menu slot="overlay">
               <a-menu-item v-if="buttonSwitch.detail">
                 <a href="javascript:;" @click="handleDetail(record)">详情</a>
               </a-menu-item>
               <template v-if="hasBpmStatus">
-                <template v-if="record.bpm_status == '1'||record.bpm_status == ''|| record.bpm_status == null">
-                    <a-menu-item v-if="buttonSwitch.delete">
-                      <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
-                        <a>删除</a>
-                      </a-popconfirm>
-                    </a-menu-item>
+                <template v-if="record.bpm_status == '1' || record.bpm_status == '' || record.bpm_status == null">
+                  <a-menu-item v-if="buttonSwitch.delete">
+                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
+                      <a>删除</a>
+                    </a-popconfirm>
+                  </a-menu-item>
                 </template>
               </template>
               <template v-else>
@@ -173,16 +199,21 @@
                     <a>删除</a>
                   </a-popconfirm>
                 </a-menu-item>
-               </template>
-              <template v-if="cgButtonLinkList && cgButtonLinkList.length>0" v-for="(btnItem,btnIndex) in cgButtonLinkList">
-                <a-menu-item :key=" 'cgbtnLink'+btnIndex " v-if="showLinkButton(btnItem,record)">
-                  <a href="javascript:void(0);" @click="cgButtonLinkHandler(record,btnItem.buttonCode,btnItem.optType)">
+              </template>
+              <template
+                v-if="cgButtonLinkList && cgButtonLinkList.length > 0"
+                v-for="(btnItem, btnIndex) in cgButtonLinkList"
+              >
+                <a-menu-item :key="'cgbtnLink' + btnIndex" v-if="showLinkButton(btnItem, record)">
+                  <a
+                    href="javascript:void(0);"
+                    @click="cgButtonLinkHandler(record, btnItem.buttonCode, btnItem.optType)"
+                  >
                     <a-icon v-if="btnItem.buttonIcon" :type="btnItem.buttonIcon" />
                     {{ btnItem.buttonName }}
                   </a>
                 </a-menu-item>
               </template>
-
             </a-menu>
           </a-dropdown>
         </span>
@@ -194,634 +225,647 @@
 
       <!-- 跳转Href的动态组件方式 -->
       <a-modal v-bind="hrefComponent.model" v-on="hrefComponent.on">
-        <component :is="hrefComponent.is" v-bind="hrefComponent.params"/>
+        <component :is="hrefComponent.is" v-bind="hrefComponent.params" />
       </a-modal>
-
     </div>
   </a-card>
 </template>
 
 <script>
-
-  import { HrefJump } from '@/mixins/OnlAutoListMixin'
-  import { postAction,getAction,deleteAction,downFile } from '@/api/manage'
-  import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
-  import { cloneObject, filterObj } from '@/utils/util'
-  import JImportModal from '@/components/jeecg/JImportModal'
-  import JSuperQuery from '@comp/jeecg/JSuperQuery'
-  import ButtonExpHandler from './ButtonExpHandler'
-
-  export default {
+import { HrefJump } from '@/mixins/OnlAutoListMixin'
+import { postAction, getAction, deleteAction, downFile } from '@/api/manage'
+import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
+import { cloneObject, filterObj } from '@/utils/util'
+import JImportModal from '@/components/jeecg/JImportModal'
+import JSuperQuery from '@comp/jeecg/JSuperQuery'
+import ButtonExpHandler from './ButtonExpHandler'
+
+export default {
     name: 'OnlCgFormAutoList',
     mixins: [HrefJump],
     components: {
-      JSuperQuery,
-      JImportModal,
+        JSuperQuery,
+        JImportModal
     },
-    data() {
-      return {
-        code: '',
-        description: '在线报表功能测试页面',
-        currentTableName:"",
-        url: {
-          getQueryInfo:'/online/cgform/api/getQueryInfo/',
-          getColumns: '/online/cgform/api/getColumns/',
-          getData: '/online/cgform/api/getData/',
-          optPre:"/online/cgform/api/form/",
-          exportXls:'/online/cgform/api/exportXls/',
-          buttonAction:'/online/cgform/api/doButton',
-        },
-        flowCodePre:"onl_",
-        isorter:{
-          column: 'createTime',
-          order: 'desc',
-        },
-        //dictOptions:{fieldName:[]}
-        dictOptions:{
-
-        },
-        cgButtonLinkList:[],
-        cgButtonList:[],
-        queryInfo:[],
-        // 查询参数,多个页面的查询参数用 code 作为键来区分
-        queryParamsMap: {},
-        toggleSearchStatus:false,
-        table: {
-          loading: true,
-          scroll:{x:false},
-          // 表头
-          columns: [],
-          //数据集
-          dataSource: [],
-          // 选择器
-          selectedRowKeys: [],
-          selectionRows: [],
-          // 分页参数
-          pagination: {
-
-          }
-        },
-        metaPagination:{
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
-        },
-        actionColumn:{
-          title: '操作',
-          dataIndex: 'action',
-          scopedSlots: { customRender: 'action' },
-          fixed:"right",
-          align:"center",
-          width:150
-        },
-        formTemplate:"99",
-        EnhanceJS:'',
-        hideColumns:[],
-        buttonSwitch:{
-          add:true,
-          update:true,
-          delete:true,
-          batch_delete:true,
-          import:true,
-          export:true,
-          detail:true
-        },
-        hasBpmStatus:false,
-        checkboxFlag:false,
-        // 高级查询
-        superQuery: {
-          // 字段列表
-          fieldList: [],
-          // 查询参数
-          params: '',
-          // 查询条件拼接方式 'and' or 'or'
-          matchType: 'and'
+    data () {
+        return {
+            code: '',
+            description: '在线报表功能测试页面',
+            currentTableName: '',
+            url: {
+                getQueryInfo: '/online/cgform/api/getQueryInfo/',
+                getColumns: '/online/cgform/api/getColumns/',
+                getData: '/online/cgform/api/getData/',
+                optPre: '/online/cgform/api/form/',
+                exportXls: '/online/cgform/api/exportXls/',
+                buttonAction: '/online/cgform/api/doButton'
+            },
+            flowCodePre: 'onl_',
+            isorter: {
+                column: 'createTime',
+                order: 'desc'
+            },
+            // dictOptions:{fieldName:[]}
+            dictOptions: {},
+            cgButtonLinkList: [],
+            cgButtonList: [],
+            queryInfo: [],
+            // 查询参数,多个页面的查询参数用 code 作为键来区分
+            queryParamsMap: {},
+            toggleSearchStatus: false,
+            table: {
+                loading: true,
+                scroll: { x: false },
+                // 表头
+                columns: [],
+                // 数据集
+                dataSource: [],
+                // 选择器
+                selectedRowKeys: [],
+                selectionRows: [],
+                // 分页参数
+                pagination: {}
+            },
+            metaPagination: {
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                    return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0
+            },
+            actionColumn: {
+                title: '操作',
+                dataIndex: 'action',
+                scopedSlots: { customRender: 'action' },
+                fixed: 'right',
+                align: 'center',
+                width: 150
+            },
+            formTemplate: '99',
+            EnhanceJS: '',
+            hideColumns: [],
+            buttonSwitch: {
+                add: true,
+                update: true,
+                delete: true,
+                batch_delete: true,
+                import: true,
+                export: true,
+                detail: true
+            },
+            hasBpmStatus: false,
+            checkboxFlag: false,
+            // 高级查询
+            superQuery: {
+                // 字段列表
+                fieldList: [],
+                // 查询参数
+                params: '',
+                // 查询条件拼接方式 'and' or 'or'
+                matchType: 'and'
+            }
         }
-      }
     },
-    created() {
-      this.initAutoList();
+    created () {
+        this.initAutoList()
     },
-    mounted(){
-      this.cgButtonJsHandler('mounted')
+    mounted () {
+        this.cgButtonJsHandler('mounted')
     },
     watch: {
-      '$route'() {
-        // 刷新参数放到这里去触发,就可以刷新相同界面了
-        this.initAutoList()
-      }
-    },
-    computed:{
-      rowSelectionConfig:function() {
-        if(!this.checkboxFlag){
-          return null
-        }
-        return {
-          fixed:true,
-          selectedRowKeys:this.table.selectedRowKeys,
-          onChange: this.handleChangeInTableSelect
+        $route () {
+            // 刷新参数放到这里去触发,就可以刷新相同界面了
+            this.initAutoList()
         }
-      },
-      queryParam: {
-        get() {
-          return this.queryParamsMap[this.code]
+    },
+    computed: {
+        rowSelectionConfig: function () {
+            if (!this.checkboxFlag) {
+                return null
+            }
+            return {
+                fixed: true,
+                selectedRowKeys: this.table.selectedRowKeys,
+                onChange: this.handleChangeInTableSelect
+            }
         },
-        set(newVal) {
-          this.$set(this.queryParamsMap, this.code, newVal)
+        queryParam: {
+            get () {
+                return this.queryParamsMap[this.code]
+            },
+            set (newVal) {
+                this.$set(this.queryParamsMap, this.code, newVal)
+            }
         }
-      }
     },
     methods: {
-      hasBpmStatusFilter(){
-        var columnObjs = this.table.columns;
-        let columns = [];
-        for (var item of columnObjs) {
-          columns.push(item.dataIndex);
-        }
-        if(columns.includes('bpm_status')||columns.includes('BPM_STATUS')){
-          this.hasBpmStatus = true;
-        }else{
-          this.hasBpmStatus = false;
-        }
-      },
-      initQueryInfo(){
-        getAction(`${this.url.getQueryInfo}${this.code}`).then((res)=>{
-          console.log("--onlineList-获取查询条件配置",res);
-          if(res.success){
-            this.queryInfo = res.result
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-      },
-      initAutoList(){
-        if(!this.$route.params.code){
-          return false
-        }
-        // 清空高级查询条件
-        this.superQuery.params = ''
-        if (this.$refs.superQuery) {
-          this.$refs.superQuery.handleReset()
-        }
-
-        this.table.loading = true
-        this.code = this.$route.params.code
-        if (!this.queryParam) {
-          this.queryParam = {}
-        }
-        getAction(`${this.url.getColumns}${this.code}`).then((res)=>{
-          console.log("--onlineList-加载动态列>>",res);
-          if(res.success){
-            if(res.result.checkboxFlag == 'Y'){
-              this.checkboxFlag = true
-            }else{
-              this.checkboxFlag = false
+        hasBpmStatusFilter () {
+            var columnObjs = this.table.columns
+            let columns = []
+            for (var item of columnObjs) {
+                columns.push(item.dataIndex)
             }
-
-            if(res.result.paginationFlag=='Y'){
-              this.table.pagination = {...this.metaPagination}
-            }else{
-              this.table.pagination = false
+            if (columns.includes('bpm_status') || columns.includes('BPM_STATUS')) {
+                this.hasBpmStatus = true
+            } else {
+                this.hasBpmStatus = false
+            }
+        },
+        initQueryInfo () {
+            getAction(`${this.url.getQueryInfo}${this.code}`).then(res => {
+                console.log('--onlineList-获取查询条件配置', res)
+                if (res.success) {
+                    this.queryInfo = res.result
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+        },
+        initAutoList () {
+            if (!this.$route.params.code) {
+                return false
+            }
+            // 清空高级查询条件
+            this.superQuery.params = ''
+            if (this.$refs.superQuery) {
+                this.$refs.superQuery.handleReset()
             }
 
-            this.fieldHrefSlots = res.result.fieldHrefSlots
-            this.dictOptions = res.result.dictOptions
-            this.formTemplate = res.result.formTemplate
-            this.description = res.result.description
-            this.currentTableName = res.result.currentTableName
-            this.initCgButtonList(res.result.cgButtonList)
-            this.initCgEnhanceJs(res.result.enhanceJs)
-            this.initButtonSwitch(res.result.hideColumns)
-            let currColumns = res.result.columns
-            for(let a=0;a<currColumns.length;a++){
-              if(currColumns[a].customRender){
-                let dictCode = currColumns[a].customRender;
-                let replaceFlag = '_replace_text_';
-                if(dictCode.startsWith(replaceFlag)){
-                  let textFieldName = dictCode.replace(replaceFlag,'')
-                  currColumns[a].customRender=(text,record)=>{
-                    return record[textFieldName]
-                  }
-                }else{
-                  currColumns[a].customRender=(text)=>{
-                    return filterMultiDictText(this.dictOptions[dictCode], text);
-                  }
+            this.table.loading = true
+            this.code = this.$route.params.code
+            if (!this.queryParam) {
+                this.queryParam = {}
+            }
+            getAction(`${this.url.getColumns}${this.code}`).then(res => {
+                console.log('--onlineList-加载动态列>>', res)
+                if (res.success) {
+                    if (res.result.checkboxFlag == 'Y') {
+                        this.checkboxFlag = true
+                    } else {
+                        this.checkboxFlag = false
+                    }
+
+                    if (res.result.paginationFlag == 'Y') {
+                        this.table.pagination = { ...this.metaPagination }
+                    } else {
+                        this.table.pagination = false
+                    }
+
+                    this.fieldHrefSlots = res.result.fieldHrefSlots
+                    this.dictOptions = res.result.dictOptions
+                    this.formTemplate = res.result.formTemplate
+                    this.description = res.result.description
+                    this.currentTableName = res.result.currentTableName
+                    this.initCgButtonList(res.result.cgButtonList)
+                    this.initCgEnhanceJs(res.result.enhanceJs)
+                    this.initButtonSwitch(res.result.hideColumns)
+                    let currColumns = res.result.columns
+                    for (let a = 0; a < currColumns.length; a++) {
+                        if (currColumns[a].customRender) {
+                            let dictCode = currColumns[a].customRender
+                            let replaceFlag = '_replace_text_'
+                            if (dictCode.startsWith(replaceFlag)) {
+                                let textFieldName = dictCode.replace(replaceFlag, '')
+                                currColumns[a].customRender = (text, record) => {
+                                    return record[textFieldName]
+                                }
+                            } else {
+                                currColumns[a].customRender = text => {
+                                    return filterMultiDictText(this.dictOptions[dictCode], text)
+                                }
+                            }
+                        }
+                    }
+                    if (res.result.scrollFlag == 1) {
+                        this.table.scroll = { x: '115%' }
+                    } else {
+                        this.table.scroll = { x: false }
+                    }
+                    currColumns.push(this.actionColumn)
+                    this.table.columns = [...currColumns]
+                    this.hasBpmStatusFilter()
+                    this.loadData()
+                    this.initQueryInfo()
+                    // 加载新路由,清空checkbox选中
+                    this.table.selectedRowKeys = []
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+        },
+        loadData (arg) {
+            if (this.table.pagination) {
+                if (arg == 1) {
+                    this.table.pagination.current = 1
                 }
-              }
+                this.table.loading = true
+                let params = this.getQueryParams() // 查询条件
+                console.log('--onlineList-查询条件-->', params)
+                getAction(`${this.url.getData}${this.code}`, params)
+                    .then(res => {
+                        console.log('--onlineList-列表数据', res)
+                        if (res.success) {
+                            let result = res.result
+                            if (Number(result.total) > 0) {
+                                this.table.pagination.total = Number(result.total)
+                                this.table.dataSource = result.records
+                            } else {
+                                this.table.pagination.total = 0
+                                this.table.dataSource = []
+                                // this.$message.warning("查无数据")
+                            }
+                        } else {
+                            this.$message.warning(res.message)
+                        }
+                    })
+                    .finally(() => {
+                        this.table.loading = false
+                    })
+            } else {
+                this.loadDataNoPage()
             }
-            if(res.result.scrollFlag==1){
-              this.table.scroll = { x :'115%' }
-            }else{
-              this.table.scroll = { x :false }
+        },
+        loadDataNoPage () {
+            this.table.loading = true
+            let param = this.getQueryParams() // 查询条件
+            param['pageSize'] = -521
+            getAction(`${this.url.getData}${this.code}`, filterObj(param))
+                .then(res => {
+                    console.log('--onlineList-列表数据', res)
+                    if (res.success) {
+                        let result = res.result
+                        if (Number(result.total) > 0) {
+                            this.table.dataSource = result.records
+                        } else {
+                            this.table.dataSource = []
+                        }
+                    } else {
+                        this.$message.warning(res.message)
+                    }
+                })
+                .finally(() => {
+                    this.table.loading = false
+                })
+        },
+        getQueryParams () {
+            let param = Object.assign({}, this.queryParam, this.isorter)
+            param.pageNo = this.table.pagination.current
+            param.pageSize = this.table.pagination.pageSize
+            param.superQueryMatchType = this.superQuery.matchType
+            param.superQueryParams = encodeURIComponent(this.superQuery.params)
+            return filterObj(param)
+        },
+        handleChangeInTableSelect (selectedRowKeys, selectionRows) {
+            this.table.selectedRowKeys = selectedRowKeys
+            this.table.selectionRows = selectionRows
+            this.selectedRowKeys = selectedRowKeys
+        },
+        handleTableChange (pagination, filters, sorter) {
+            // TODO 筛选
+            if (Object.keys(sorter).length > 0) {
+                this.isorter.column = sorter.field
+                this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
             }
-            currColumns.push(this.actionColumn);
-            this.table.columns = [...currColumns]
-            this.hasBpmStatusFilter();
-            this.loadData();
-            this.initQueryInfo();
-            //加载新路由,清空checkbox选中
-            this.table.selectedRowKeys = [];
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-      },
-      loadData(arg){
-        if(this.table.pagination){
-          if(arg==1){
-            this.table.pagination.current=1
-          }
-          this.table.loading = true
-          let params = this.getQueryParams();//查询条件
-          console.log("--onlineList-查询条件-->",params)
-          getAction(`${this.url.getData}${this.code}`,params).then((res)=>{
-            console.log("--onlineList-列表数据",res)
-            if(res.success){
-              let result = res.result;
-              if(Number(result.total)>0){
-                this.table.pagination.total = Number(result.total)
-                this.table.dataSource = result.records
-              }else{
-                this.table.pagination.total=0;
-                this.table.dataSource=[]
-                //this.$message.warning("查无数据")
-              }
-            }else{
-              this.$message.warning(res.message)
+            this.table.pagination = pagination
+            this.loadData()
+        },
+        handleAdd () {
+            this.cgButtonJsHandler('beforeAdd')
+            this.$refs.modal.add(this.formTemplate)
+        },
+        handleImportXls () {
+            this.$refs.importModal.show()
+        },
+        importOk () {
+            this.loadData(1)
+        },
+        handleExportXls2 () {
+            let param = this.queryParam
+            if (this.table.selectedRowKeys && this.table.selectedRowKeys.length > 0) {
+                param['selections'] = this.table.selectedRowKeys.join(',')
             }
-          }).finally(() => {
-            this.table.loading = false
-          })
-        }else{
-          this.loadDataNoPage()
-        }
-      },
-      loadDataNoPage(){
-        this.table.loading = true
-        let param = this.getQueryParams()//查询条件
-        param['pageSize'] = -521;
-        getAction(`${this.url.getData}${this.code}`,filterObj(param)).then((res)=>{
-          console.log("--onlineList-列表数据",res)
-          if(res.success){
-            let result = res.result;
-            if(Number(result.total)>0){
-              this.table.dataSource = result.records
-            }else{
-              this.table.dataSource=[]
+            let paramsStr = encodeURI(JSON.stringify(param))
+            console.log('paramsStr: ' + paramsStr)
+            let url = window._CONFIG['domianURL'] + this.url.exportXls + this.code + '?paramsStr=' + paramsStr
+            window.location.href = url
+        },
+        handleExportXls () {
+            let param = this.queryParam
+            if (this.table.selectedRowKeys && this.table.selectedRowKeys.length > 0) {
+                param['selections'] = this.table.selectedRowKeys.join(',')
             }
-          }else{
-            this.$message.warning(res.message)
-          }
-        }).finally(() => {
-          this.table.loading = false
-        })
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam,this.isorter);
-        param.pageNo = this.table.pagination.current;
-        param.pageSize = this.table.pagination.pageSize;
-        param.superQueryMatchType = this.superQuery.matchType
-        param.superQueryParams = encodeURIComponent(this.superQuery.params)
-        return filterObj(param);
-      },
-      handleChangeInTableSelect(selectedRowKeys, selectionRows) {
-        this.table.selectedRowKeys = selectedRowKeys
-        this.table.selectionRows = selectionRows
-        this.selectedRowKeys = selectedRowKeys
-      },
-      handleTableChange(pagination, filters, sorter){
-        //TODO 筛选
-        if (Object.keys(sorter).length>0){
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend"==sorter.order?"asc":"desc"
-        }
-        this.table.pagination = pagination;
-        this.loadData();
-      },
-      handleAdd(){
-        this.cgButtonJsHandler('beforeAdd')
-        this.$refs.modal.add(this.formTemplate);
-      },
-      handleImportXls(){
-        this.$refs.importModal.show()
-      },
-      importOk(){
-        this.loadData(1)
-      },
-      handleExportXls2(){
-        let param = this.queryParam;
-        if(this.table.selectedRowKeys && this.table.selectedRowKeys.length>0){
-          param['selections'] = this.table.selectedRowKeys.join(",")
-        }
-        let paramsStr = encodeURI(JSON.stringify(param));
-        console.log('paramsStr: ' + paramsStr)
-        let url = window._CONFIG['domianURL']+this.url.exportXls+this.code+"?paramsStr="+paramsStr
-        window.location.href = url;
-      },
-      handleExportXls(){
-        let param = this.queryParam;
-        if(this.table.selectedRowKeys && this.table.selectedRowKeys.length>0){
-          param['selections'] = this.table.selectedRowKeys.join(",")
-        }
-        console.log("导出参数",param)
-        let paramsStr = JSON.stringify(filterObj(param));
-        downFile(this.url.exportXls+this.code,{paramsStr:paramsStr}).then((data)=>{
-          if (!data) {
-            this.$message.warning("文件下载失败")
-            return
-          }
-          if (typeof window.navigator.msSaveBlob !== 'undefined') {
-            window.navigator.msSaveBlob(new Blob([data]), this.description+'.xls')
-          }else{
-            let url = window.URL.createObjectURL(new Blob([data]))
-            let link = document.createElement('a')
-            link.style.display = 'none'
-            link.href = url
-            link.setAttribute('download', this.description+'.xls')
-            document.body.appendChild(link)
-            link.click()
-            document.body.removeChild(link); //下载完成移除元素
-            window.URL.revokeObjectURL(url); //释放掉blob对象
-          }
-        })
-      },
-      handleEdit(record){
-        this.cgButtonLinkHandler(record,"beforeEdit","js")
-        this.$refs.modal.edit(this.formTemplate,record.id);
-      },
-      showLinkButton(item,record){
-        let btn = new ButtonExpHandler(item.exp,record);
-        return btn.show;
-      },
-      handleDetail(record){
-        this.$refs.modal.detail(this.formTemplate,record.id);
-      },
-      handleDeleteOne(record){
-        this.cgButtonLinkHandler(record,"beforeDelete","js")
-        this.handleDelete(record.id)
-      },
-      handleDelete(id){
-        deleteAction(this.url.optPre+this.code+"/"+id).then((res)=>{
-          if(res.success){
-            this.$message.success(res.message)
+            console.log('导出参数', param)
+            let paramsStr = JSON.stringify(filterObj(param))
+            downFile(this.url.exportXls + this.code, { paramsStr: paramsStr }).then(data => {
+                if (!data) {
+                    this.$message.warning('文件下载失败')
+                    return
+                }
+                if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                    window.navigator.msSaveBlob(new Blob([data]), this.description + '.xls')
+                } else {
+                    let url = window.URL.createObjectURL(new Blob([data]))
+                    let link = document.createElement('a')
+                    link.style.display = 'none'
+                    link.href = url
+                    link.setAttribute('download', this.description + '.xls')
+                    document.body.appendChild(link)
+                    link.click()
+                    document.body.removeChild(link) // 下载完成移除元素
+                    window.URL.revokeObjectURL(url) // 释放掉blob对象
+                }
+            })
+        },
+        handleEdit (record) {
+            this.cgButtonLinkHandler(record, 'beforeEdit', 'js')
+            this.$refs.modal.edit(this.formTemplate, record.id)
+        },
+        showLinkButton (item, record) {
+            let btn = new ButtonExpHandler(item.exp, record)
+            return btn.show
+        },
+        handleDetail (record) {
+            this.$refs.modal.detail(this.formTemplate, record.id)
+        },
+        handleDeleteOne (record) {
+            this.cgButtonLinkHandler(record, 'beforeDelete', 'js')
+            this.handleDelete(record.id)
+        },
+        handleDelete (id) {
+            deleteAction(this.url.optPre + this.code + '/' + id).then(res => {
+                if (res.success) {
+                    this.$message.success(res.message)
+                    this.loadData()
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+        },
+
+        handleFormSuccess () {
             this.loadData()
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-      },
+        },
+        // 查询完 schema 后,生成高级查询的字段列表
+        handleGetSchema (schema) {
+            if (schema && schema.properties) {
+                let setField = (array, field) => {
+                    let type = field.type || 'string'
+                    type = type === 'inputNumber' ? 'number' : type
+                    array.push({
+                        type: type,
+                        value: field.key,
+                        text: field.title,
+                        // 额外字典参数
+                        dictCode: field.dictCode,
+                        dictTable: field.dictTable,
+                        dictText: field.dictText,
+                        options: field.enum || field.options,
+                        order: field.order
+                    })
+                }
+                let fieldList = []
+                for (let key in schema.properties) {
+                    if (!schema.properties.hasOwnProperty(key)) {
+                        continue
+                    }
+                    let field = schema.properties[key]
+                    // tab = 子表
+                    if (field.view === 'tab') {
+                        let subTable = {
+                            type: 'sub-table',
+                            value: field.key,
+                            text: field.describe,
+                            children: []
+                        }
+                        for (let column of field.columns) {
+                            setField(subTable.children, column)
+                        }
+                        fieldList.push(subTable)
+                    } else {
+                        field.key = key
+                        setField(fieldList, field)
+                    }
+                }
+                // 冒泡排序
+                for (let i = 0; i < fieldList.length; i++) {
+                    for (let j = i + 1; j < fieldList.length; j++) {
+                        let temp1 = fieldList[i]
+                        let temp2 = fieldList[j]
+                        if (temp1.order > temp2.order) {
+                            fieldList[i] = temp2
+                            fieldList[j] = temp1
+                        }
+                    }
+                }
+                this.superQuery.fieldList = fieldList
+            }
+        },
+        onClearSelected () {
+            this.table.selectedRowKeys = []
+            this.table.selectionRows = []
+        },
+        getImgView (text) {
+            if (text && text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            return window._CONFIG['staticDomainURL'] + '/' + text
+        },
+        downloadRowFile (text) {
+            if (!text) {
+                this.$message.warning('未知的文件')
+                return
+            }
+            if (text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            window.open(window._CONFIG['staticDomainURL'] + '/' + text) // TODO 下载的方法
+        },
+        handleDelBatch () {
+            if (this.table.selectedRowKeys.length <= 0) {
+                this.$message.warning('请选择一条记录!')
+                return false
+            } else {
+                let ids = ''
+                let that = this
+                that.table.selectedRowKeys.forEach(function (val) {
+                    ids += val + ','
+                })
+                that.$confirm({
+                    title: '确认删除',
+                    content: '是否删除选中数据?',
+                    onOk: function () {
+                        that.handleDelete(ids)
+                        that.onClearSelected()
+                    }
+                })
+            }
+        },
 
-      handleFormSuccess(){
-        this.loadData()
-      },
-      // 查询完 schema 后,生成高级查询的字段列表
-      handleGetSchema(schema) {
-        if (schema && schema.properties) {
-          let setField = (array, field) => {
-            let type = field.type || 'string'
-            type = (type === 'inputNumber' ? 'number' : type)
-            array.push({
-              type: type,
-              value: field.key,
-              text: field.title,
-              // 额外字典参数
-              dictCode: field.dictCode,
-              dictTable: field.dictTable,
-              dictText: field.dictText,
-              options: field.enum || field.options,
-              order: field.order,
-            })
-          }
-          let fieldList = []
-          for (let key in schema.properties) {
-            if (!schema.properties.hasOwnProperty(key)) {
-              continue
+        searchByquery () {
+            this.loadData(1)
+        },
+        searchReset () {
+            this.queryParam = {}
+            this.loadData(1)
+        },
+        handleToggleSearch () {
+            this.toggleSearchStatus = !this.toggleSearchStatus
+        },
+        getFormatDate (text) {
+            if (!text) {
+                return ''
             }
-            let field = schema.properties[key]
-            // tab = 子表
-            if (field.view === 'tab') {
-              let subTable = {
-                type: 'sub-table',
-                value: field.key,
-                text: field.describe,
-                children: []
-              }
-              for (let column of field.columns) {
-                setField(subTable.children, column)
-              }
-              fieldList.push(subTable)
+            let a = text
+            if (a.length > 10) {
+                a = a.substring(0, 10)
+            }
+            return a
+        },
+        getImportUrl () {
+            return '/online/cgform/api/importXls/' + this.code
+        },
+        initCgEnhanceJs (enhanceJs) {
+            // console.log("--onlineList-js增强",enhanceJs)
+            if (enhanceJs) {
+                let Obj = eval('(' + enhanceJs + ')')
+                this.EnhanceJS = new Obj(getAction, postAction, deleteAction)
+                this.cgButtonJsHandler('created')
             } else {
-              field.key = key
-              setField(fieldList, field)
+                this.EnhanceJS = ''
             }
-          }
-          // 冒泡排序
-          for (let i = 0; i < fieldList.length; i++) {
-            for (let j = i + 1; j < fieldList.length; j++) {
-              let temp1 = fieldList[i]
-              let temp2 = fieldList[j]
-              if (temp1.order > temp2.order) {
-                fieldList[i] = temp2
-                fieldList[j] = temp1
-              }
+        },
+        initCgButtonList (btnList) {
+            let linkArr = []
+            let buttonArr = []
+            if (btnList && btnList.length > 0) {
+                for (let i = 0; i < btnList.length; i++) {
+                    let temp = btnList[i]
+                    if (temp.buttonStyle == 'button') {
+                        buttonArr.push(temp)
+                    } else if (temp.buttonStyle == 'link') {
+                        linkArr.push(temp)
+                    }
+                }
             }
-          }
-          this.superQuery.fieldList = fieldList
-        }
-      },
-      onClearSelected(){
-        this.table.selectedRowKeys = []
-        this.table.selectionRows = []
-      },
-      getImgView(text){
-        if(text && text.indexOf(",")>0){
-          text = text.substring(0,text.indexOf(","))
-        }
-        return window._CONFIG['staticDomainURL']+"/"+text
-      },
-      downloadRowFile(text){
-        if(!text){
-          this.$message.warning("未知的文件")
-          return;
-        }
-        if(text.indexOf(",")>0){
-          text = text.substring(0,text.indexOf(","))
-        }
-        window.open(window._CONFIG['staticDomainURL']+"/"+text);//TODO 下载的方法
-      },
-      handleDelBatch(){
-        if(this.table.selectedRowKeys.length<=0){
-          this.$message.warning('请选择一条记录!');
-          return false;
-        }else{
-          let ids = "";
-          let that = this;
-          that.table.selectedRowKeys.forEach(function(val) {
-            ids+=val+",";
-          });
-          that.$confirm({
-            title:"确认删除",
-            content:"是否删除选中数据?",
-            onOk: function(){
-              that.handleDelete(ids)
-              that.onClearSelected();
+            this.cgButtonLinkList = [...linkArr]
+            this.cgButtonList = [...buttonArr]
+        },
+        cgButtonJsHandler (buttonCode) {
+            if (this.EnhanceJS[buttonCode]) {
+                this.EnhanceJS[buttonCode](this)
             }
-          });
-        }
-      },
-
-      searchByquery(){
-        this.loadData(1);
-      },
-      searchReset(){
-        this.queryParam = {}
-        this.loadData(1);
-      },
-      handleToggleSearch(){
-        this.toggleSearchStatus = !this.toggleSearchStatus;
-      },
-      getFormatDate(text){
-        if(!text){
-          return ''
-        }
-        let a = text;
-        if(a.length>10){
-          a = a.substring(0,10);
-        }
-        return a;
-      },
-      getImportUrl(){
-        return '/online/cgform/api/importXls/'+this.code
-      },
-      initCgEnhanceJs(enhanceJs){
-        //console.log("--onlineList-js增强",enhanceJs)
-        if(enhanceJs){
-          let Obj = eval ("(" + enhanceJs + ")");
-          this.EnhanceJS = new Obj(getAction,postAction,deleteAction);
-          this.cgButtonJsHandler('created')
-        }else{
-          this.EnhanceJS = ''
-        }
-      },
-      initCgButtonList(btnList){
-        let linkArr = []
-        let buttonArr = []
-        if(btnList && btnList.length>0){
-          for(let i=0;i<btnList.length;i++){
-            let temp = btnList[i]
-            if(temp.buttonStyle=='button'){
-              buttonArr.push(temp)
-            }else if(temp.buttonStyle=='link'){
-              linkArr.push(temp)
+        },
+        cgButtonActionHandler (buttonCode) {
+            // 处理自定义button的 需要配置该button自定义sql
+            if (!this.table.selectedRowKeys || this.table.selectedRowKeys.length == 0) {
+                this.$message.warning('请先选中一条记录')
+                return false
             }
-          }
-        }
-        this.cgButtonLinkList = [...linkArr]
-        this.cgButtonList=[...buttonArr]
-      },
-      cgButtonJsHandler(buttonCode){
-        if(this.EnhanceJS[buttonCode]){
-          this.EnhanceJS[buttonCode](this)
-        }
-      },
-      cgButtonActionHandler(buttonCode){
-        //处理自定义button的 需要配置该button自定义sql
-        if(!this.table.selectedRowKeys || this.table.selectedRowKeys.length==0){
-          this.$message.warning("请先选中一条记录")
-          return false
-        }
-        if(this.table.selectedRowKeys.length>1){
-          this.$message.warning("请只选中一条记录")
-          return false
-        }
-        let params = {
-          formId:this.code,
-          buttonCode:buttonCode,
-          dataId:this.table.selectedRowKeys[0]
-        }
-        console.log("自定义按钮请求后台参数:",params)
-        postAction(this.url.buttonAction,params).then(res=>{
-          if(res.success){
-            this.loadData()
-            this.$message.success("处理完成!")
-          }else{
-            this.$message.warning("处理失败!")
-          }
-        })
-
-      },
-      cgButtonLinkHandler(record,buttonCode,optType){
-        if(optType=="js"){
-          if(this.EnhanceJS[buttonCode]){
-            this.EnhanceJS[buttonCode](this,record)
-          }
-        }else if(optType=="action"){
-          let params = {
-            formId:this.code,
-            buttonCode:buttonCode,
-            dataId:record.id
-          }
-          console.log("自定义按钮link请求后台参数:",params)
-          postAction(this.url.buttonAction,params).then(res=>{
-            if(res.success){
-              this.loadData()
-              this.$message.success("处理完成!")
-            }else{
-              this.$message.warning("处理失败!")
+            if (this.table.selectedRowKeys.length > 1) {
+                this.$message.warning('请只选中一条记录')
+                return false
             }
-          })
-        }
-      },
-      initButtonSwitch(hideColumns){
-        Object.keys(this.buttonSwitch).forEach(key=>{
-          this.buttonSwitch[key]=true
-        })
-        if(hideColumns && hideColumns.length>0){
-          Object.keys(this.buttonSwitch).forEach(key=>{
-            if(hideColumns.indexOf(key)>=0){
-              this.buttonSwitch[key]=false
+            let params = {
+                formId: this.code,
+                buttonCode: buttonCode,
+                dataId: this.table.selectedRowKeys[0]
             }
-          })
-        }
-      },
+            console.log('自定义按钮请求后台参数:', params)
+            postAction(this.url.buttonAction, params).then(res => {
+                if (res.success) {
+                    this.loadData()
+                    this.$message.success('处理完成!')
+                } else {
+                    this.$message.warning('处理失败!')
+                }
+            })
+        },
+        cgButtonLinkHandler (record, buttonCode, optType) {
+            if (optType == 'js') {
+                if (this.EnhanceJS[buttonCode]) {
+                    this.EnhanceJS[buttonCode](this, record)
+                }
+            } else if (optType == 'action') {
+                let params = {
+                    formId: this.code,
+                    buttonCode: buttonCode,
+                    dataId: record.id
+                }
+                console.log('自定义按钮link请求后台参数:', params)
+                postAction(this.url.buttonAction, params).then(res => {
+                    if (res.success) {
+                        this.loadData()
+                        this.$message.success('处理完成!')
+                    } else {
+                        this.$message.warning('处理失败!')
+                    }
+                })
+            }
+        },
+        initButtonSwitch (hideColumns) {
+            Object.keys(this.buttonSwitch).forEach(key => {
+                this.buttonSwitch[key] = true
+            })
+            if (hideColumns && hideColumns.length > 0) {
+                Object.keys(this.buttonSwitch).forEach(key => {
+                    if (hideColumns.indexOf(key) >= 0) {
+                        this.buttonSwitch[key] = false
+                    }
+                })
+            }
+        },
 
-      // 高级查询
-      handleSuperQuery(params, matchType) {
-        if (!params || params.length === 0) {
-          this.superQuery.params = ''
-        } else {
-          this.superQuery.params = JSON.stringify(params)
+        // 高级查询
+        handleSuperQuery (params, matchType) {
+            if (!params || params.length === 0) {
+                this.superQuery.params = ''
+            } else {
+                this.superQuery.params = JSON.stringify(params)
+            }
+            this.superQuery.matchType = matchType
+            this.loadData()
         }
-        this.superQuery.matchType = matchType
-        this.loadData()
-      },
-
     }
-  }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <style>
-  .ant-card-body .table-operator{
-    margin-bottom: 18px;
-  }
-  .ant-table-tbody .ant-table-row td{
-    padding-top:15px;
-    padding-bottom:15px;
-  }
-  .anty-row-operator button{margin: 0 5px}
-  .ant-btn-danger{background-color: #ffffff}
-
-  .anty-img-wrap{height:25px;position: relative;}
-  .anty-img-wrap > img{max-height:100%;}
-  .ant-modal-cust-warp{height: 100%}
-  .ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
-  .ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
-</style>
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+.anty-row-operator button {
+  margin: 0 5px;
+}
+.ant-btn-danger {
+  background-color: #ffffff;
+}
+
+.anty-img-wrap {
+  height: 25px;
+  position: relative;
+}
+.anty-img-wrap > img {
+  max-height: 100%;
+}
+.ant-modal-cust-warp {
+  height: 100%;
+}
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+</style>

+ 594 - 557
src/views/modules/online/cgform/auto/OnlCgformTreeList.vue

@@ -3,25 +3,41 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button v-if="buttonSwitch.add" @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button v-if="buttonSwitch.import" @click="handleImportXls" type="primary" icon="upload" style="margin-left:8px">导入</a-button>
-      <a-button v-if="buttonSwitch.export" @click="handleExportXls" type="primary" icon="download" style="margin-left:8px">导出</a-button>
-      <template v-if="cgButtonList && cgButtonList.length>0" v-for="(item,index) in cgButtonList">
+      <a-button
+        v-if="buttonSwitch.import"
+        @click="handleImportXls"
+        type="primary"
+        icon="upload"
+        style="margin-left:8px"
+      >导入</a-button
+      >
+      <a-button
+        v-if="buttonSwitch.export"
+        @click="handleExportXls"
+        type="primary"
+        icon="download"
+        style="margin-left:8px"
+      >导出</a-button
+      >
+      <template v-if="cgButtonList && cgButtonList.length > 0" v-for="(item, index) in cgButtonList">
         <a-button
-          v-if=" item.optType=='js' "
-          :key=" 'cgbtn'+index "
+          v-if="item.optType == 'js'"
+          :key="'cgbtn' + index"
           @click="cgButtonJsHandler(item.buttonCode)"
           type="primary"
           :icon="item.buttonIcon"
-          style="margin-left:8px">
+          style="margin-left:8px"
+        >
           {{ item.buttonName }}
         </a-button>
         <a-button
-          v-else-if=" item.optType=='action' "
-          :key=" 'cgbtn'+index "
+          v-else-if="item.optType == 'action'"
+          :key="'cgbtn' + index"
           @click="cgButtonActionHandler(item.buttonCode)"
           type="primary"
           :icon="item.buttonIcon"
-          style="margin-left:8px">
+          style="margin-left:8px"
+        >
           {{ item.buttonName }}
         </a-button>
       </template>
@@ -33,13 +49,16 @@
         v-show="selectedRowKeys.length > 0"
         ghost
         type="primary"
-        icon="delete">批量删除</a-button>
+        icon="delete"
+      >批量删除</a-button
+      >
     </div>
 
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i>
-        已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
+        已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项&nbsp;&nbsp;
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -55,8 +74,8 @@
         v-bind="tableProps"
         @expand="handleExpand"
         style="min-height: 300px"
-        :expandedRowKeys="expandedRowKeys">
-
+        :expandedRowKeys="expandedRowKeys"
+      >
         <template slot="dateSlot" slot-scope="text">
           <span>{{ getDateNoTime(text) }}</span>
         </template>
@@ -67,7 +86,13 @@
 
         <template slot="imgSlot" slot-scope="text">
           <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
-          <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+          <img
+            v-else
+            :src="getImgView(text)"
+            height="25px"
+            alt="图片不存在"
+            style="max-width:80px;font-size: 12px;font-style: italic;"
+          />
         </template>
 
         <template slot="fileSlot" slot-scope="text">
@@ -84,613 +109,625 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-
-          <template v-if="showOptButton('update',record)">
+          <template v-if="showOptButton('update', record)">
             <a @click="handleEdit(record)">编辑</a>
-            <a-divider type="vertical"/>
+            <a-divider type="vertical" />
           </template>
 
           <a-dropdown>
-            <a class="ant-dropdown-link">
-              更多 <a-icon type="down" />
-            </a>
+            <a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
             <a-menu slot="overlay">
-              <a-menu-item >
+              <a-menu-item>
                 <a @click="handleDetail(record)">详情</a>
               </a-menu-item>
-              <a-menu-item v-if="showOptButton('delete',record)">
+              <a-menu-item v-if="showOptButton('delete', record)">
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
                   <a>删除</a>
                 </a-popconfirm>
               </a-menu-item>
               <!-- 自定义按钮 -->
-              <template v-if="cgButtonLinkList && cgButtonLinkList.length>0" v-for="(btnItem,btnIndex) in cgButtonLinkList">
-                <a-menu-item :key=" 'cgbtnLink'+btnIndex ">
-                  <a href="javascript:void(0);" @click="cgButtonLinkHandler(record,btnItem.buttonCode,btnItem.optType)">
+              <template
+                v-if="cgButtonLinkList && cgButtonLinkList.length > 0"
+                v-for="(btnItem, btnIndex) in cgButtonLinkList"
+              >
+                <a-menu-item :key="'cgbtnLink' + btnIndex">
+                  <a
+                    href="javascript:void(0);"
+                    @click="cgButtonLinkHandler(record, btnItem.buttonCode, btnItem.optType)"
+                  >
                     <a-icon v-if="btnItem.buttonIcon" :type="btnItem.buttonIcon" />
                     {{ btnItem.buttonName }}
                   </a>
                 </a-menu-item>
               </template>
-
             </a-menu>
           </a-dropdown>
         </span>
-
       </a-table>
 
       <onl-cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></onl-cgform-auto-modal>
 
       <j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
-
     </div>
   </a-card>
 </template>
 
 <script>
+import { getAction, postAction, deleteAction, downFile } from '@/api/manage'
+import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
+import { filterObj } from '@/utils/util'
+import JImportModal from '@/components/jeecg/JImportModal'
 
-  import { getAction,postAction,deleteAction,downFile } from '@/api/manage'
-  import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
-  import { filterObj } from '@/utils/util';
-  import JImportModal from '@/components/jeecg/JImportModal'
-
-  export default {
+export default {
     name: 'OnlCgformTreeList',
     components: {
-      JImportModal,
+        JImportModal
     },
-    data() {
-      return {
-        code: '87b55a515d3441b6b98e48e5b35474a6',
-        description: '在线报表功能测试页面',
-        currentTableName:"",
-        pidField:"",
-        hasChildrenField:"",
-        textField:'',
-        loading: false,
-        // 表头
-        columns: [],
-        //数据集
-        dataSource: [],
-        // 选择器
-        selectedRowKeys: [],
-        selectionRows: [],
-        // 分页参数
-        pagination: {
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
-        },
-
-        url: {
-          getColumns: '/online/cgform/api/getColumns/',
-          getTreeData: '/online/cgform/api/getTreeData/',
-          optPre:"/online/cgform/api/form/",
-          exportXls:'/online/cgform/api/exportXls/',
-          buttonAction:'/online/cgform/api/doButton',
-        },
-        isorter:{
-          column: 'create_time',
-          order: 'desc',
-        },
-        dictOptions:{
-
-        },
+    data () {
+        return {
+            code: '87b55a515d3441b6b98e48e5b35474a6',
+            description: '在线报表功能测试页面',
+            currentTableName: '',
+            pidField: '',
+            hasChildrenField: '',
+            textField: '',
+            loading: false,
+            // 表头
+            columns: [],
+            // 数据集
+            dataSource: [],
+            // 选择器
+            selectedRowKeys: [],
+            selectionRows: [],
+            // 分页参数
+            pagination: {
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                    return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0
+            },
 
-        queryParam:{
+            url: {
+                getColumns: '/online/cgform/api/getColumns/',
+                getTreeData: '/online/cgform/api/getTreeData/',
+                optPre: '/online/cgform/api/form/',
+                exportXls: '/online/cgform/api/exportXls/',
+                buttonAction: '/online/cgform/api/doButton'
+            },
+            isorter: {
+                column: 'create_time',
+                order: 'desc'
+            },
+            dictOptions: {},
 
-        },
-        actionColumn:{
-          title: '操作',
-          dataIndex: 'action',
-          scopedSlots: { customRender: 'action' },
-          fixed:"right",
-          align:"center",
-          width:150
-        },
-        formTemplate:"99",
+            queryParam: {},
+            actionColumn: {
+                title: '操作',
+                dataIndex: 'action',
+                scopedSlots: { customRender: 'action' },
+                fixed: 'right',
+                align: 'center',
+                width: 150
+            },
+            formTemplate: '99',
 
-        /*自定义按钮-link*/
-        cgButtonLinkList:[],
-        /*自定义按钮-button*/
-        cgButtonList:[],
-        /*JS增强*/
-        EnhanceJS:'',
-        /*操作按钮权限*/
-        buttonSwitch:{
-          add:true,
-          update:true,
-          delete:true,
-          batch_delete:true,
-          import:true,
-          export:true
-        },
-        expandedRowKeys:[],
-        hasBpmStatus:false,
-        flowCodePre:"onl_",
-
-      }
+            /* 自定义按钮-link */
+            cgButtonLinkList: [],
+            /* 自定义按钮-button */
+            cgButtonList: [],
+            /* JS增强 */
+            EnhanceJS: '',
+            /* 操作按钮权限 */
+            buttonSwitch: {
+                add: true,
+                update: true,
+                delete: true,
+                batch_delete: true,
+                import: true,
+                export: true
+            },
+            expandedRowKeys: [],
+            hasBpmStatus: false,
+            flowCodePre: 'onl_'
+        }
     },
-    created() {
-      this.initAutoListConfig().then(()=>{
-        this.loadData(1)
-      }).catch(msg=>{
-        console.log(msg)
-      })
+    created () {
+        this.initAutoListConfig()
+            .then(() => {
+                this.loadData(1)
+            })
+            .catch(msg => {
+                console.log(msg)
+            })
     },
-    mounted(){
-      //this.cgButtonJsHandler('mounted')
+    mounted () {
+    // this.cgButtonJsHandler('mounted')
     },
     watch: {
-      '$route'() {
-        // 刷新参数放到这里去触发,就可以刷新相同界面了
-        this.initAutoListConfig().then(()=>{
-          this.loadData(1)
-        }).catch(msg=>{
-          console.log(msg)
-        })
-      }
+        $route () {
+            // 刷新参数放到这里去触发,就可以刷新相同界面了
+            this.initAutoListConfig()
+                .then(() => {
+                    this.loadData(1)
+                })
+                .catch(msg => {
+                    console.log(msg)
+                })
+        }
     },
     computed: {
-      tableProps() {
-        let _this = this
-        return {
-          // 列表项是否可选择
-          // https://vue.ant.design/components/table-cn/#rowSelection
-          rowSelection: {
-            selectedRowKeys: _this.selectedRowKeys,
-            onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
-          }
+        tableProps () {
+            let _this = this
+            return {
+                // 列表项是否可选择
+                // https://vue.ant.design/components/table-cn/#rowSelection
+                rowSelection: {
+                    selectedRowKeys: _this.selectedRowKeys,
+                    onChange: selectedRowKeys => (_this.selectedRowKeys = selectedRowKeys)
+                }
+            }
         }
-      }
     },
     methods: {
-      resetData(){
-        this.description=''
-        this.currentTableName=''
-        this.pidField=''
-        this.hasChildrenField=''
-        this.textField=''
-        this.columns = []
-        this.dataSource = []
-        this.selectedRowKeys=[]
-        this.selectionRows=[]
-      },
-      initAutoListConfig() {
-        return new Promise((resolve, reject) => {
-          if (!this.$route.params.code) {
-            reject("列表加载需要参数CODE为空!")
-          } else {
-            this.resetData()
-            this.loading = true
-            this.code = this.$route.params.code
-            getAction(`${this.url.getColumns}${this.code}`)
-              .then(res => {
-                console.log("--onlineList-加载动态列>>", res);
-                if(res.success){
-                  this.configInfohandler(res)
-                  resolve();
-                }else{
-                  reject("onlineList-加载表配置信息失败")
+        resetData () {
+            this.description = ''
+            this.currentTableName = ''
+            this.pidField = ''
+            this.hasChildrenField = ''
+            this.textField = ''
+            this.columns = []
+            this.dataSource = []
+            this.selectedRowKeys = []
+            this.selectionRows = []
+        },
+        initAutoListConfig () {
+            return new Promise((resolve, reject) => {
+                if (!this.$route.params.code) {
+                    reject('列表加载需要参数CODE为空!')
+                } else {
+                    this.resetData()
+                    this.loading = true
+                    this.code = this.$route.params.code
+                    getAction(`${this.url.getColumns}${this.code}`)
+                        .then(res => {
+                            console.log('--onlineList-加载动态列>>', res)
+                            if (res.success) {
+                                this.configInfohandler(res)
+                                resolve()
+                            } else {
+                                reject('onlineList-加载表配置信息失败')
+                            }
+                            this.loading = false
+                        })
+                        .catch(err => {
+                            reject(err)
+                        })
+                }
+            })
+        },
+        configInfohandler (res) {
+            this.dictOptions = res.result.dictOptions
+            this.formTemplate = res.result.formTemplate
+            this.description = res.result.description
+            this.currentTableName = res.result.currentTableName
+            this.pidField = res.result.pidField
+            this.hasChildrenField = res.result.hasChildrenField
+            this.textField = res.result.textField
+            // 自定义按钮
+            this.initCgButtonList(res.result.cgButtonList)
+            // JS增强
+            this.initCgEnhanceJs(res.result.enhanceJs)
+            // 操作按钮权限
+            this.initButtonSwitch(res.result.hideColumns)
+            let currColumns = res.result.columns
+            let textFieldIndex = -1
+            let hasBpmStatus = false
+            for (let a = 0; a < currColumns.length; a++) {
+                currColumns[a].align = 'left'
+                // 找到显示列
+                if (this.textField == currColumns[a].dataIndex) {
+                    textFieldIndex = a
+                }
+                // 数据字典翻译
+                if (currColumns[a].customRender) {
+                    let dictCode = currColumns[a].customRender
+                    currColumns[a].customRender = text => {
+                        return filterMultiDictText(this.dictOptions[dictCode], text)
+                    }
+                }
+                // 判断是否有bpm_status
+                if (currColumns[a].dataIndex.toLowerCase() == 'bpm_status') {
+                    hasBpmStatus = true
                 }
-                this.loading = false
-              })
-              .catch(err => {
-                reject(err)
-              })
-          }
-        })
-      },
-      configInfohandler(res){
-        this.dictOptions = res.result.dictOptions
-        this.formTemplate = res.result.formTemplate
-        this.description = res.result.description
-        this.currentTableName = res.result.currentTableName
-        this.pidField = res.result.pidField
-        this.hasChildrenField = res.result.hasChildrenField
-        this.textField = res.result.textField
-        //自定义按钮
-        this.initCgButtonList(res.result.cgButtonList)
-        //JS增强
-        this.initCgEnhanceJs(res.result.enhanceJs)
-        //操作按钮权限
-        this.initButtonSwitch(res.result.hideColumns)
-        let currColumns = res.result.columns
-        let textFieldIndex = -1
-        let hasBpmStatus = false
-        for(let a=0;a<currColumns.length;a++){
-          currColumns[a].align = 'left'
-          //找到显示列
-          if(this.textField==currColumns[a].dataIndex){
-            textFieldIndex = a
-          }
-          //数据字典翻译
-          if(currColumns[a].customRender){
-            let dictCode = currColumns[a].customRender;
-            currColumns[a].customRender=(text)=>{
-              return filterMultiDictText(this.dictOptions[dictCode], text);
             }
-          }
-          //判断是否有bpm_status
-          if(currColumns[a].dataIndex.toLowerCase()=='bpm_status'){
-            hasBpmStatus = true;
-          }
-        }
-        this.hasBpmStatus = hasBpmStatus;
+            this.hasBpmStatus = hasBpmStatus
 
-        if(textFieldIndex!=-1){
-          let textFieldColumn = currColumns.splice(textFieldIndex,1)
-          currColumns.unshift(textFieldColumn[0])
-        }
-        currColumns.push(this.actionColumn);
-        this.columns = [...currColumns]
-      },
-      //加载根节点
-      loadData(arg){
-        if(arg==1){
-          this.pagination.current=1
-        }
-        this.loading = true
-        this.expandedRowKeys=[]
-        let params = this.getQueryParams();//查询条件
-        params[this.pidField]='0'
-        console.log("--onlineList-查询条件-->",params)
-        getAction(`${this.url.getTreeData}${this.code}`,params).then((res)=>{
-          console.log("--onlineList-列表数据",res)
-          if(res.success){
-            let result = res.result;
-            if(Number(result.total)>0){
-              this.pagination.total = Number(result.total)
-              let dataSource = res.result.records.map(item => {
-                // 判断是否标记了带有子级
-                if (item[this.hasChildrenField] === true || item[this.hasChildrenField]=='1') {
-                  let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
-                  item.children = [loadChild]
-                }
-                return item
-              })
-              this.dataSource = dataSource
-            }else{
-              this.pagination.total=0;
-              this.dataSource=[]
+            if (textFieldIndex != -1) {
+                let textFieldColumn = currColumns.splice(textFieldIndex, 1)
+                currColumns.unshift(textFieldColumn[0])
+            }
+            currColumns.push(this.actionColumn)
+            this.columns = [...currColumns]
+        },
+        // 加载根节点
+        loadData (arg) {
+            if (arg == 1) {
+                this.pagination.current = 1
             }
-          }else{
-            this.$message.warning(res.message)
-          }
-          this.loading = false
-        })
-      },
-      //加载叶子节点
-      handleExpand(expanded, record) {
-        // 判断是否是展开状态
-        if (expanded) {
-          this.expandedRowKeys.push(record.id)
-          if (record.children.length>0 && record.children[0].isLoading === true) {
-            let params = this.getQueryParams();//查询条件
-            params[this.pidField] = record.id
-            getAction(`${this.url.getTreeData}${this.code}`,params).then((res)=>{
-              if(res.success){
-                if(Number(res.result.total)>0){
-                  let dataSource = res.result.records.map(item => {
-                    // 判断是否标记了带有子级
-                    if (item[this.hasChildrenField] === true || item[this.hasChildrenField]=='1') {
-                      let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
-                      item.children = [loadChild]
+            this.loading = true
+            this.expandedRowKeys = []
+            let params = this.getQueryParams() // 查询条件
+            params[this.pidField] = '0'
+            console.log('--onlineList-查询条件-->', params)
+            getAction(`${this.url.getTreeData}${this.code}`, params).then(res => {
+                console.log('--onlineList-列表数据', res)
+                if (res.success) {
+                    let result = res.result
+                    if (Number(result.total) > 0) {
+                        this.pagination.total = Number(result.total)
+                        let dataSource = res.result.records.map(item => {
+                            // 判断是否标记了带有子级
+                            if (item[this.hasChildrenField] === true || item[this.hasChildrenField] == '1') {
+                                let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
+                                item.children = [loadChild]
+                            }
+                            return item
+                        })
+                        this.dataSource = dataSource
+                    } else {
+                        this.pagination.total = 0
+                        this.dataSource = []
                     }
-                    return item
-                  })
-                  record.children = dataSource
-                }else{
-                  record.children=''
-                  record.hasChildrenField='0'
+                } else {
+                    this.$message.warning(res.message)
                 }
-              }else{
-                this.$message.warning(res.message)
-              }
+                this.loading = false
             })
-          }
-        }else{
-          let keyIndex = this.expandedRowKeys.indexOf(record.id)
-          if(keyIndex>=0){
-            this.expandedRowKeys.splice(keyIndex, 1);
-          }
-        }
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam,this.isorter);
-        param.pageNo = this.pagination.current;
-        param.pageSize = this.pagination.pageSize;
-        return filterObj(param);
-      },
-      initCgButtonList(btnList){
-        let linkArr = []
-        let buttonArr = []
-        if(btnList && btnList.length>0){
-          for(let i=0;i<btnList.length;i++){
-            let temp = btnList[i]
-            if(temp.buttonStyle=='button'){
-              buttonArr.push(temp)
-            }else if(temp.buttonStyle=='link'){
-              linkArr.push(temp)
+        },
+        // 加载叶子节点
+        handleExpand (expanded, record) {
+            // 判断是否是展开状态
+            if (expanded) {
+                this.expandedRowKeys.push(record.id)
+                if (record.children.length > 0 && record.children[0].isLoading === true) {
+                    let params = this.getQueryParams() // 查询条件
+                    params[this.pidField] = record.id
+                    getAction(`${this.url.getTreeData}${this.code}`, params).then(res => {
+                        if (res.success) {
+                            if (Number(res.result.total) > 0) {
+                                let dataSource = res.result.records.map(item => {
+                                    // 判断是否标记了带有子级
+                                    if (item[this.hasChildrenField] === true || item[this.hasChildrenField] == '1') {
+                                        let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
+                                        item.children = [loadChild]
+                                    }
+                                    return item
+                                })
+                                record.children = dataSource
+                            } else {
+                                record.children = ''
+                                record.hasChildrenField = '0'
+                            }
+                        } else {
+                            this.$message.warning(res.message)
+                        }
+                    })
+                }
+            } else {
+                let keyIndex = this.expandedRowKeys.indexOf(record.id)
+                if (keyIndex >= 0) {
+                    this.expandedRowKeys.splice(keyIndex, 1)
+                }
             }
-          }
-        }
-        this.cgButtonLinkList = [...linkArr]
-        this.cgButtonList=[...buttonArr]
-      },
-      initCgEnhanceJs(enhanceJs){
-        //console.log("--onlineList-js增强",enhanceJs)
-        if(enhanceJs){
-          let Obj = eval ("(" + enhanceJs + ")");
-          this.EnhanceJS = new Obj(getAction,postAction,deleteAction);
-          this.cgButtonJsHandler('created')
-        }else{
-          this.EnhanceJS = ''
-        }
-      },
-      initButtonSwitch(hideColumns){
-        if(hideColumns && hideColumns.length>0){
-          Object.keys(this.buttonSwitch).forEach(key=>{
-            if(hideColumns.indexOf(key)>=0){
-              this.buttonSwitch[key]=false
+        },
+        getQueryParams () {
+            let param = Object.assign({}, this.queryParam, this.isorter)
+            param.pageNo = this.pagination.current
+            param.pageSize = this.pagination.pageSize
+            return filterObj(param)
+        },
+        initCgButtonList (btnList) {
+            let linkArr = []
+            let buttonArr = []
+            if (btnList && btnList.length > 0) {
+                for (let i = 0; i < btnList.length; i++) {
+                    let temp = btnList[i]
+                    if (temp.buttonStyle == 'button') {
+                        buttonArr.push(temp)
+                    } else if (temp.buttonStyle == 'link') {
+                        linkArr.push(temp)
+                    }
+                }
             }
-          })
-
-        }
-      },
-      onClearSelected(){
-        this.selectedRowKeys = []
-        this.selectionRows = []
-      },
-      handleTableChange(pagination, filters, sorter){
-        //TODO 筛选
-        if (Object.keys(sorter).length>0){
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend"==sorter.order?"asc":"desc"
-        }
-        this.pagination = pagination;
-        this.loadData();
-      },
-      /*-------数据格式化-begin----------*/
-      getDateNoTime(text){
-        if(!text){
-          return ''
-        }
-        let a = text;
-        if(a.length>10){
-          a = a.substring(0,10);
-        }
-        return a;
-      },
-      getImgView(text){
-        if(text && text.indexOf(",")>0){
-          text = text.substring(0,text.indexOf(","))
-        }
-        return window._CONFIG['staticDomainURL']+"/"+text
-      },
-      downloadRowFile(text){
-        if(!text){
-          this.$message.warning("未知的文件")
-          return;
-        }
-        if(text.indexOf(",")>0){
-          text = text.substring(0,text.indexOf(","))
-        }
-        window.open(window._CONFIG['staticDomainURL']+"/"+text);
-      },
-      /*-------数据格式化-end----------*/
-
-      /*-------功能按钮触发事件-begin----------*/
-      handleEdit(record){
-        this.cgButtonLinkHandler(record,"beforeEdit","js")
-        this.$refs.modal.edit(this.formTemplate,record.id);
-      },
-      handleDetail(record){
-        this.$refs.modal.detail(this.formTemplate,record.id);
-      },
-      handleDeleteOne(record){
-        this.cgButtonLinkHandler(record,"beforeDelete","js")
-        this.handleDelete(record.id)
-      },
-      handleDelete(id){
-        deleteAction(this.url.optPre+this.code+"/"+id).then((res)=>{
-          if(res.success){
-            this.$message.success(res.message)
+            this.cgButtonLinkList = [...linkArr]
+            this.cgButtonList = [...buttonArr]
+        },
+        initCgEnhanceJs (enhanceJs) {
+            // console.log("--onlineList-js增强",enhanceJs)
+            if (enhanceJs) {
+                let Obj = eval('(' + enhanceJs + ')')
+                this.EnhanceJS = new Obj(getAction, postAction, deleteAction)
+                this.cgButtonJsHandler('created')
+            } else {
+                this.EnhanceJS = ''
+            }
+        },
+        initButtonSwitch (hideColumns) {
+            if (hideColumns && hideColumns.length > 0) {
+                Object.keys(this.buttonSwitch).forEach(key => {
+                    if (hideColumns.indexOf(key) >= 0) {
+                        this.buttonSwitch[key] = false
+                    }
+                })
+            }
+        },
+        onClearSelected () {
+            this.selectedRowKeys = []
+            this.selectionRows = []
+        },
+        handleTableChange (pagination, filters, sorter) {
+            // TODO 筛选
+            if (Object.keys(sorter).length > 0) {
+                this.isorter.column = sorter.field
+                this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
+            }
+            this.pagination = pagination
             this.loadData()
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-      },
-      handleAdd(){
-        this.cgButtonJsHandler('beforeAdd')
-        this.$refs.modal.add(this.formTemplate);
-      },
-      handleFormSuccess(){
-        this.loadData()
-      },
-      handleImportXls(){
-        this.$refs.importModal.show()
-      },
-      importOk(){
-        this.loadData(1)
-      },
-      getImportUrl(){
-        return '/online/cgform/api/importXls/'+this.code
-      },
-      handleExportXls(){
-        let param = this.queryParam;
-        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
-          param['selections'] = this.selectedRowKeys.join(",")
-        }
-        console.log("导出参数",param)
-        let paramsStr = JSON.stringify(filterObj(param));
-        downFile(this.url.exportXls+this.code,{paramsStr:paramsStr}).then((data)=>{
-          if (!data) {
-            this.$message.warning("文件下载失败")
-            return
-          }
-          if (typeof window.navigator.msSaveBlob !== 'undefined') {
-            window.navigator.msSaveBlob(new Blob([data]), this.description+'.xls')
-          }else{
-            let url = window.URL.createObjectURL(new Blob([data]))
-            let link = document.createElement('a')
-            link.style.display = 'none'
-            link.href = url
-            link.setAttribute('download', this.description+'.xls')
-            document.body.appendChild(link)
-            link.click()
-            document.body.removeChild(link); //下载完成移除元素
-            window.URL.revokeObjectURL(url); //释放掉blob对象
-          }
-        })
-      },
-      handleDelBatch(){
-        if(this.selectedRowKeys.length<=0){
-          this.$message.warning('请选择一条记录!');
-          return false;
-        }else{
-          let ids = "";
-          let that = this;
-          that.selectedRowKeys.forEach(function(val) {
-            ids+=val+",";
-          });
-          that.$confirm({
-            title:"确认删除",
-            content:"是否删除选中数据?",
-            onOk: function(){
-              that.handleDelete(ids)
-              that.onClearSelected();
+        },
+        /* -------数据格式化-begin---------- */
+        getDateNoTime (text) {
+            if (!text) {
+                return ''
             }
-          });
-        }
-      },
-      /*-------功能按钮触发事件-begin----------*/
-
-      /*-------JS增强-begin----------*/
-      cgButtonLinkHandler(record,buttonCode,optType){
-        if(optType=="js"){
-          if(this.EnhanceJS[buttonCode]){
-            this.EnhanceJS[buttonCode](this,record)
-          }
-        }else if(optType=="action"){
-          let params = {
-            formId:this.code,
-            buttonCode:buttonCode,
-            dataId:record.id
-          }
-          console.log("自定义按钮link请求后台参数:",params)
-          postAction(this.url.buttonAction,params).then(res=>{
-            if(res.success){
-              this.loadData()
-              this.$message.success("处理完成!")
-            }else{
-              this.$message.warning("处理失败!")
+            let a = text
+            if (a.length > 10) {
+                a = a.substring(0, 10)
             }
-          })
-        }
-      },
-      cgButtonJsHandler(buttonCode){
-        if(this.EnhanceJS[buttonCode]){
-          this.EnhanceJS[buttonCode](this)
-        }
-      },
-      cgButtonActionHandler(buttonCode){
-        //处理自定义button的 需要配置该button自定义sql
-        if(!this.selectedRowKeys || this.selectedRowKeys.length==0){
-          this.$message.warning("请先选中一条记录")
-          return false
-        }
-        if(this.selectedRowKeys.length>1){
-          this.$message.warning("请只选中一条记录")
-          return false
-        }
-        let params = {
-          formId:this.code,
-          buttonCode:buttonCode,
-          dataId:this.selectedRowKeys[0]
-        }
-        console.log("自定义按钮请求后台参数:",params)
-        postAction(this.url.buttonAction,params).then(res=>{
-          if(res.success){
+            return a
+        },
+        getImgView (text) {
+            if (text && text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            return window._CONFIG['staticDomainURL'] + '/' + text
+        },
+        downloadRowFile (text) {
+            if (!text) {
+                this.$message.warning('未知的文件')
+                return
+            }
+            if (text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            window.open(window._CONFIG['staticDomainURL'] + '/' + text)
+        },
+        /* -------数据格式化-end---------- */
+
+        /* -------功能按钮触发事件-begin---------- */
+        handleEdit (record) {
+            this.cgButtonLinkHandler(record, 'beforeEdit', 'js')
+            this.$refs.modal.edit(this.formTemplate, record.id)
+        },
+        handleDetail (record) {
+            this.$refs.modal.detail(this.formTemplate, record.id)
+        },
+        handleDeleteOne (record) {
+            this.cgButtonLinkHandler(record, 'beforeDelete', 'js')
+            this.handleDelete(record.id)
+        },
+        handleDelete (id) {
+            deleteAction(this.url.optPre + this.code + '/' + id).then(res => {
+                if (res.success) {
+                    this.$message.success(res.message)
+                    this.loadData()
+                } else {
+                    this.$message.warning(res.message)
+                }
+            })
+        },
+        handleAdd () {
+            this.cgButtonJsHandler('beforeAdd')
+            this.$refs.modal.add(this.formTemplate)
+        },
+        handleFormSuccess () {
             this.loadData()
-            this.$message.success("处理完成!")
-          }else{
-            this.$message.warning("处理失败!")
-          }
-        })
+        },
+        handleImportXls () {
+            this.$refs.importModal.show()
+        },
+        importOk () {
+            this.loadData(1)
+        },
+        getImportUrl () {
+            return '/online/cgform/api/importXls/' + this.code
+        },
+        handleExportXls () {
+            let param = this.queryParam
+            if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
+                param['selections'] = this.selectedRowKeys.join(',')
+            }
+            console.log('导出参数', param)
+            let paramsStr = JSON.stringify(filterObj(param))
+            downFile(this.url.exportXls + this.code, { paramsStr: paramsStr }).then(data => {
+                if (!data) {
+                    this.$message.warning('文件下载失败')
+                    return
+                }
+                if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                    window.navigator.msSaveBlob(new Blob([data]), this.description + '.xls')
+                } else {
+                    let url = window.URL.createObjectURL(new Blob([data]))
+                    let link = document.createElement('a')
+                    link.style.display = 'none'
+                    link.href = url
+                    link.setAttribute('download', this.description + '.xls')
+                    document.body.appendChild(link)
+                    link.click()
+                    document.body.removeChild(link) // 下载完成移除元素
+                    window.URL.revokeObjectURL(url) // 释放掉blob对象
+                }
+            })
+        },
+        handleDelBatch () {
+            if (this.selectedRowKeys.length <= 0) {
+                this.$message.warning('请选择一条记录!')
+                return false
+            } else {
+                let ids = ''
+                let that = this
+                that.selectedRowKeys.forEach(function (val) {
+                    ids += val + ','
+                })
+                that.$confirm({
+                    title: '确认删除',
+                    content: '是否删除选中数据?',
+                    onOk: function () {
+                        that.handleDelete(ids)
+                        that.onClearSelected()
+                    }
+                })
+            }
+        },
+        /* -------功能按钮触发事件-begin---------- */
 
-      },
-      /*-------JS增强-end----------*/
-      showOptButton(opt,record){
-        //只有当按钮属性为false,或是按钮属性为true但是流程已提交时才隐藏
-        if(!this.buttonSwitch[opt]){
-          return false
-        }else{
-          if(this.hasBpmStatus){
-            if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
-              return false
+        /* -------JS增强-begin---------- */
+        cgButtonLinkHandler (record, buttonCode, optType) {
+            if (optType == 'js') {
+                if (this.EnhanceJS[buttonCode]) {
+                    this.EnhanceJS[buttonCode](this, record)
+                }
+            } else if (optType == 'action') {
+                let params = {
+                    formId: this.code,
+                    buttonCode: buttonCode,
+                    dataId: record.id
+                }
+                console.log('自定义按钮link请求后台参数:', params)
+                postAction(this.url.buttonAction, params).then(res => {
+                    if (res.success) {
+                        this.loadData()
+                        this.$message.success('处理完成!')
+                    } else {
+                        this.$message.warning('处理失败!')
+                    }
+                })
+            }
+        },
+        cgButtonJsHandler (buttonCode) {
+            if (this.EnhanceJS[buttonCode]) {
+                this.EnhanceJS[buttonCode](this)
+            }
+        },
+        cgButtonActionHandler (buttonCode) {
+            // 处理自定义button的 需要配置该button自定义sql
+            if (!this.selectedRowKeys || this.selectedRowKeys.length == 0) {
+                this.$message.warning('请先选中一条记录')
+                return false
+            }
+            if (this.selectedRowKeys.length > 1) {
+                this.$message.warning('请只选中一条记录')
+                return false
+            }
+            let params = {
+                formId: this.code,
+                buttonCode: buttonCode,
+                dataId: this.selectedRowKeys[0]
+            }
+            console.log('自定义按钮请求后台参数:', params)
+            postAction(this.url.buttonAction, params).then(res => {
+                if (res.success) {
+                    this.loadData()
+                    this.$message.success('处理完成!')
+                } else {
+                    this.$message.warning('处理失败!')
+                }
+            })
+        },
+        /* -------JS增强-end---------- */
+        showOptButton (opt, record) {
+            // 只有当按钮属性为false,或是按钮属性为true但是流程已提交时才隐藏
+            if (!this.buttonSwitch[opt]) {
+                return false
+            } else {
+                if (this.hasBpmStatus) {
+                    if (record.bpm_status != null && record.bpm_status != '' && record.bpm_status != '1') {
+                        return false
+                    }
+                }
             }
-          }
-        }
-        return true
-      },
-      showViewFlowButton(record){
-        if(this.hasBpmStatus){
-          if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
             return true
-          }
-        }
-        return false
-      },
-      startProcess: function(record){
-        var that = this;
-        this.$confirm({
-          title:"提示",
-          content:"确认提交流程吗?",
-          onOk: function(){
-            var param = {
-              flowCode:that.flowCodePre+that.currentTableName,
-              id:record.id,
-              formUrl:"modules/bpm/task/form/OnlineFormDetail",
-              formUrlMobile:"modules/bpm/task/form/OnlineFormDetail"
+        },
+        showViewFlowButton (record) {
+            if (this.hasBpmStatus) {
+                if (record.bpm_status != null && record.bpm_status != '' && record.bpm_status != '1') {
+                    return true
+                }
             }
-            postAction(that.url.startProcess,param).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              }else{
-                that.$message.warning(res.message);
-              }
-            });
-          }
-        });
-      },
-
+            return false
+        },
+        startProcess: function (record) {
+            var that = this
+            this.$confirm({
+                title: '提示',
+                content: '确认提交流程吗?',
+                onOk: function () {
+                    var param = {
+                        flowCode: that.flowCodePre + that.currentTableName,
+                        id: record.id,
+                        formUrl: 'modules/bpm/task/form/OnlineFormDetail',
+                        formUrlMobile: 'modules/bpm/task/form/OnlineFormDetail'
+                    }
+                    postAction(that.url.startProcess, param).then(res => {
+                        if (res.success) {
+                            that.$message.success(res.message)
+                            that.loadData()
+                            that.onClearSelected()
+                        } else {
+                            that.$message.warning(res.message)
+                        }
+                    })
+                }
+            })
+        }
     }
-  }
+}
 </script>
 <style>
-  .ant-card-body .table-operator{
-    margin-bottom: 18px;
-  }
-  .ant-table-tbody .ant-table-row td{
-    padding-top:15px;
-    padding-bottom:15px;
-  }
-  .anty-row-operator button{margin: 0 5px}
-  .ant-btn-danger{background-color: #ffffff}
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+.anty-row-operator button {
+  margin: 0 5px;
+}
+.ant-btn-danger {
+  background-color: #ffffff;
+}
 
-  .anty-img-wrap{height:25px;position: relative;}
-  .anty-img-wrap > img{max-height:100%;}
-  .ant-modal-cust-warp{height: 100%}
-  .ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
-  .ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
-</style>
+.anty-img-wrap {
+  height: 25px;
+  position: relative;
+}
+.anty-img-wrap > img {
+  max-height: 100%;
+}
+.ant-modal-cust-warp {
+  height: 100%;
+}
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+</style>

+ 39 - 20
src/views/oa/enterpriseAnnouncement.vue

@@ -32,23 +32,23 @@
     <!-- 新增 批量删除 -->
     <div class="table-add">
       <a-button @click="addAnn" type="primary">新增</a-button>
-      <!-- 批量操作-----------------------------------
-        v-if="selectedRowKeys.length > 0"
-      ------------------------------------------------>
-      <a-dropdown>
+
+      <!-- 批量操作 -->
+      <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除 </a-menu-item>
         </a-menu>
-        <a-button style="margin-left:24px"> 批量操作 <a-icon type="down"/></a-button>
+        <a-button style="margin-left:24px">批量操作<a-icon type="down"/></a-button>
       </a-dropdown>
     </div>
 
+    <!-- ------------------------------------------------------------ -->
     <div>
       <!-- 已选择 清空 -->
       <div class="ant-alert ant-alert-info" style="margin: 20px 0;background:#e6f7ff;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
-        <!-- {{ selectedRowKeys.length }} -->
-        <a style="font-weight: 600">2</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
       <!-- table -->
@@ -60,22 +60,35 @@
           :loading="loading"
           :pagination="pagination"
           :row-key="record => record.id"
-          :rowSelection="rowSelection"
+          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
           @change="handleTableChange"
         >
           <!-- 发布 -->
           <span slot="isReleaseSlot" slot-scope="text, record">
-            <a-tag color="orange" v-if="record.isRelease == '0'">
+            <a-tag color="#f50" v-if="record.isRelease == '0'">
               未发布
             </a-tag>
-            <a-tag color="green" v-else>
+            <a-tag color="#87d068" v-else>
               已发布
             </a-tag>
           </span>
 
+          <!-- 类型 -->
+          <span slot="whatType" slot-scope="text, record">
+            <a-tag color="orange" v-if="record.type == '项目'">
+              项目
+            </a-tag>
+            <a-tag color="purple" v-if="record.type == '人事'">
+              人事
+            </a-tag>
+            <a-tag color="cyan" v-if="record.type == '财务'">
+              财务
+            </a-tag>
+          </span>
+
           <!-- 操作 -->
           <span slot="operationSlot" slot-scope="text, record">
-            <a href="javascript:void(0);" @click="editAnn(record)"> 编辑 </a>
+            <a href="javascript:void(0);" @click="editAnn(record)">编辑</a>
 
             <a-divider type="vertical" v-if="record.isRelease == '0'" />
 
@@ -87,7 +100,7 @@
               ok-text="是"
               cancel-text="否"
             >
-              <a href="javascript:void(0);" class="sendGr"> 发布 </a>
+              <a href="javascript:void(0);" class="sendGr">发布</a>
             </a-popconfirm>
             <!-- --------------------------------------------------- -->
             <a-divider type="vertical" v-if="record.isRelease == '1'" />
@@ -98,13 +111,13 @@
               ok-text="是"
               cancel-text="否"
             >
-              <a href="javascript:void(0);" class="sendGr"> 取消发布 </a>
+              <a href="javascript:void(0);" class="sendGr">取消发布</a>
             </a-popconfirm>
 
             <a-divider type="vertical" />
 
             <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="delAnn(record)">
-              <a href="javascript:void(0);" class="delRed"> 删除 </a>
+              <a href="javascript:void(0);" class="delRed">删除</a>
             </a-popconfirm>
           </span>
         </a-table>
@@ -143,6 +156,7 @@ export default {
                 {
                     title: '类型',
                     dataIndex: 'type',
+                    scopedSlots: { customRender: 'whatType' },
                     align: 'center'
                 },
                 {
@@ -182,14 +196,21 @@ export default {
                 pageNo: '1', // 页码
                 title: '', // 标题
                 isRelease: '' // 是否发布
-            }
+            },
+            selectedRowKeys: []
         }
     },
     created () {
         this.getAnnList() // 渲染公告
     },
     methods: {
-    // 查询日程计划列表(根据参数不同,传递对应的数据)
+        batchDel () {},
+        // 勾选
+        onSelectChange (keys, rows) {
+            this.selectedRowKeys = keys
+            this.selectedRows = rows
+        },
+        // 查询日程计划列表(根据参数不同,传递对应的数据)
         getAnnList () {
             this.$nextTick(() => {
                 enterpriseEList(this.queryParam).then(res => {
@@ -268,8 +289,6 @@ export default {
             })
         },
 
-        // 批量删除
-        batchDel () {},
         // 清空
         onClearSelected () {},
         // ??

Some files were not shown because too many files changed in this diff