Browse Source

全部提交一次

liangyan0105 3 years ago
parent
commit
ee10ea4184

+ 9 - 14
src/assets/less/overwrite.css

@@ -41,20 +41,19 @@ img {
 .content .main {
   min-height: 780px;
 }
-.content .main .Header {
+.content .main /deep/ .ant-layout-header {
   padding: 0;
-  color: white;
-  background-color: #347b98;
-  border-bottom-right-radius: 16px;
-  border-bottom-left-radius: 16px;
+  margin: 0;
   letter-spacing: 1px;
+  padding-left: 14px;
+  background-color: transparent;
 }
 .content .main .Header span {
   font-size: 20px;
   font-weight: 700;
-  margin-left: 34%;
+  margin-left: 12px;
   margin-top: 4px;
-  color: white;
+  color: rgba(52, 123, 152);
 }
 .content .main .todoPage .cardTask {
   width: 100%;
@@ -107,11 +106,6 @@ img {
   border-radius: 999em;
   padding: 24px 20px;
 }
-.content .main .todoPage /deep/ .ant-layout-header {
-  padding: 0;
-  margin: 0;
-  padding: 0 24px;
-}
 .content .main .todoPage /deep/ .ant-card-head {
   color: #092834;
   font-weight: 700;
@@ -144,13 +138,14 @@ img {
   height: 0;
 }
 .content .main .todoBody .priorityComm {
-  padding: 4px 10px;
+  padding: 3px 8px;
   color: #092834;
   letter-spacing: 1px;
 }
 .content .main .todoBody .statusComm {
-  padding: 4px 6px;
+  padding: 3px 8px;
   color: #092834;
+  letter-spacing: 1px;
 }
 .content .main .todoBody .resultComm {
   padding: 4px 10px;

+ 19 - 16
src/assets/less/overwrite.less

@@ -49,20 +49,28 @@ img {
   .main {
     min-height: 780px; //所有内容设置最小高度
     //分页头部公共
-    .Header {
+    /deep/.ant-layout-header {
       padding: 0;
-      color: white;
-      background-color: #347b98;
-      // box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-      border-bottom-right-radius: 16px;
-      border-bottom-left-radius: 16px;
+      margin: 0;
       letter-spacing: 1px;
+      padding-left: 14px;
+      // padding: 0 24px;
+      background-color: transparent;
+    }
+    .Header {
+      // padding: 0;
+      // color: rgba(52, 123, 152);
+      // background-color: #347b98;
+      // background-color: none !important;
+      // box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
+      // border-bottom-right-radius: 16px;
+      // border-bottom-left-radius: 16px;
       span {
         font-size: 20px;
         font-weight: 700;
-        margin-left: 34%;
+        margin-left: 12px;
         margin-top: 4px;
-        color: white;
+        color: rgba(52, 123, 152);
       }
     }
 
@@ -130,12 +138,6 @@ img {
         padding: 24px 20px;
       }
 
-      /deep/.ant-layout-header {
-        padding: 0;
-        margin: 0;
-        padding: 0 24px;
-      }
-
       /deep/.ant-card-head {
         color: #092834;
         font-weight: 700;
@@ -178,14 +180,15 @@ img {
     .todoBody {
       //优先级
       .priorityComm {
-        padding: 4px 10px;
+        padding: 3px 8px;
         color: #092834;
         letter-spacing: 1px;
       }
       // 状态
       .statusComm {
-        padding: 4px 6px;
+        padding: 3px 8px;
         color: #092834;
+        letter-spacing: 1px;
       }
 
       // 结果

+ 386 - 385
src/components/jeecg/JSuperQuery.vue

@@ -1,185 +1,189 @@
 <template>
-<div class="j-super-query-box">
-
-  <div @click="visible=true">
-    <slot>
-      <a-tooltip v-if="superQueryFlag" :mouseLeaveDelay="0.2">
-        <template slot="title">
-          <span>已有高级查询条件生效</span>
-          <a-divider type="vertical"/>
-          <a @click="handleReset">清空</a>
-        </template>
-        <a-button type="primary">
-          <a-icon type="appstore" theme="twoTone" :spin="true"></a-icon>
-          <span>高级查询</span>
-        </a-button>
-      </a-tooltip>
-      <a-button v-else type="primary" icon="filter" @click="visible=true">高级查询</a-button>
-    </slot>
-  </div>
-
-  <a-modal
-    title="高级查询构造器"
-    :width="1000"
-    :visible="visible"
-    @cancel="handleCancel"
-    :mask="false"
-    class="j-super-query-modal"
-    style="top:5%;max-height: 95%;">
-
-    <template slot="footer">
-      <div style="float: left">
-        <a-button :loading="loading" @click="handleReset">重置</a-button>
-        <a-button :loading="loading" @click="handleSave">保存查询条件</a-button>
-      </div>
-      <a-button :loading="loading" @click="handleCancel">关闭</a-button>
-      <a-button :loading="loading" type="primary" @click="handleOk">查询</a-button>
-    </template>
-
-    <a-spin :spinning="loading">
-      <a-row>
-        <a-col :sm="24" :md="24-5">
-
-          <a-empty v-if="queryParamsModel.length === 0">
-            <div slot="description">
-              <span>没有任何查询条件</span>
-              <a-divider type="vertical"/>
-              <a @click="handleAdd">点击新增</a>
-            </div>
-          </a-empty>
-
-          <a-form v-else layout="inline">
-
-            <a-form-item label="过滤条件匹配" style="margin-bottom: 12px;">
-              <a-select v-model="selectValue" :getPopupContainer="node=>node.parentNode">
-                <a-select-option value="and">AND(所有条件都要求匹配)</a-select-option>
-                <a-select-option value="or">OR(条件中的任意一个匹配)</a-select-option>
-              </a-select>
-            </a-form-item>
-
-            <a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in queryParamsModel" :key="index">
-
-              <a-col :span="8">
-                <a-tree-select
-                  showSearch
-                  v-model="item.field"
-                  :treeData="fieldTreeData"
-                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
-                  placeholder="选择查询字段"
-                  allowClear
-                  treeDefaultExpandAll
-                  :getPopupContainer="node=>node.parentNode"
-                  style="width: 100%"
-                  @select="(val,option)=>handleSelected(option,item)"
-                >
-                </a-tree-select>
-              </a-col>
-
-              <a-col :span="4">
-                <a-select placeholder="匹配规则" v-model="item.rule" :getPopupContainer="node=>node.parentNode">
-                  <a-select-option value="eq">等于</a-select-option>
-                  <a-select-option value="ne">不等于</a-select-option>
-                  <a-select-option value="gt">大于</a-select-option>
-                  <a-select-option value="ge">大于等于</a-select-option>
-                  <a-select-option value="lt">小于</a-select-option>
-                  <a-select-option value="le">小于等于</a-select-option>
-                  <a-select-option value="right_like">以..开始</a-select-option>
-                  <a-select-option value="left_like">以..结尾</a-select-option>
-                  <a-select-option value="like">包含</a-select-option>
-                  <a-select-option value="in">在...中</a-select-option>
+  <div class="j-super-query-box">
+
+    <div @click=" ">
+      <slot>
+        <a-tooltip v-if="superQueryFlag" :mouseLeaveDelay="0.2">
+          <template slot="title">
+            <span>已有高级查询条件生效</span>
+            <a-divider type="vertical"/>
+            <a @click="handleReset">清空</a>
+          </template>
+          <a-button type="primary">
+            <a-icon type="appstore" theme="twoTone" :spin="true"></a-icon>
+            <span>高级查询</span>
+          </a-button>
+        </a-tooltip>
+        <a-button v-else type="primary" icon="filter" @click="visible=true">高级查询</a-button>
+      </slot>
+    </div>
+
+    <a-modal
+      title="高级查询构造器"
+      :width="1000"
+      :visible="visible"
+      @cancel="handleCancel"
+      :mask="false"
+      class="j-super-query-modal"
+      style="top:5%;max-height: 95%;">
+
+      <template slot="footer">
+        <div style="float: left">
+          <a-button :loading="loading" @click="handleReset">重置</a-button>
+          <a-button :loading="loading" @click="handleSave">保存查询条件</a-button>
+        </div>
+        <a-button :loading="loading" @click="handleCancel">关闭</a-button>
+        <a-button :loading="loading" type="primary" @click="handleOk">查询</a-button>
+      </template>
+
+      <a-spin :spinning="loading">
+        <a-row>
+          <a-col :sm="24" :md="24-5">
+
+            <a-empty v-if="queryParamsModel.length === 0">
+              <div slot="description">
+                <span>没有任何查询条件</span>
+                <a-divider type="vertical"/>
+                <a @click="handleAdd">点击新增</a>
+              </div>
+            </a-empty>
+
+            <a-form v-else layout="inline">
+
+              <a-form-item label="过滤条件匹配" style="margin-bottom: 12px;">
+                <a-select v-model="selectValue" :getPopupContainer="node=>node.parentNode">
+                  <a-select-option value="and">AND(所有条件都要求匹配)</a-select-option>
+                  <a-select-option value="or">OR(条件中的任意一个匹配)</a-select-option>
                 </a-select>
-              </a-col>
-
-              <a-col :span="8">
-                <template v-if="item.dictCode">
-                  <template v-if="item.type === 'table-dict'">
-                    <j-popup
-                      v-model="item.val"
-                      :code="item.dictTable"
-                      :field="item.dictCode"
-                      :orgFields="item.dictCode"
-                      :destFields="item.dictCode"
-                    ></j-popup>
+              </a-form-item>
+
+              <a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in queryParamsModel" :key="index">
+
+                <a-col :span="8">
+                  <a-tree-select
+                    showSearch
+                    v-model="item.field"
+                    :treeData="fieldTreeData"
+                    :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                    placeholder="选择查询字段"
+                    allowClear
+                    treeDefaultExpandAll
+                    :getPopupContainer="node=>node.parentNode"
+                    style="width: 100%"
+                    @select="(val,option)=>handleSelected(option,item)"
+                  >
+                  </a-tree-select>
+                </a-col>
+
+                <a-col :span="4">
+                  <a-select placeholder="匹配规则" v-model="item.rule" :getPopupContainer="node=>node.parentNode">
+                    <a-select-option value="eq">等于</a-select-option>
+                    <a-select-option value="ne">不等于</a-select-option>
+                    <a-select-option value="gt">大于</a-select-option>
+                    <a-select-option value="ge">大于等于</a-select-option>
+                    <a-select-option value="lt">小于</a-select-option>
+                    <a-select-option value="le">小于等于</a-select-option>
+                    <a-select-option value="right_like">以..开始</a-select-option>
+                    <a-select-option value="left_like">以..结尾</a-select-option>
+                    <a-select-option value="like">包含</a-select-option>
+                    <a-select-option value="in">在...中</a-select-option>
+                  </a-select>
+                </a-col>
+
+                <a-col :span="8">
+                  <template v-if="item.dictCode">
+                    <template v-if="item.type === 'table-dict'">
+                      <j-popup
+                        v-model="item.val"
+                        :code="item.dictTable"
+                        :field="item.dictCode"
+                        :orgFields="item.dictCode"
+                        :destFields="item.dictCode"
+                      ></j-popup>
+                    </template>
+                    <j-dict-select-tag v-else v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
                   </template>
-                  <j-dict-select-tag v-else v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
-                </template>
-                <j-select-multi-user
-                  v-else-if="item.type === 'select-user'"
-                  v-model="item.val"
-                  :buttons="false"
-                  :multiple="false"
-                  placeholder="请选择用户"
-                  :returnKeys="['id', item.customReturnField || 'username']"
-                />
-                <j-select-depart
-                  v-else-if="item.type === 'select-depart'"
-                  v-model="item.val"
-                  :multi="false"
-                  placeholder="请选择部门"
-                  :customReturnField="item.customReturnField || 'id'"
-                />
-                <a-select v-else-if="item.options instanceof Array" v-model="item.val" :options="item.options" allowClear placeholder="请选择"/>
-                <j-date v-else-if=" item.type=='date' " v-model="item.val" placeholder="请选择日期" style="width: 100%"></j-date>
-                <j-date v-else-if=" item.type=='datetime' " v-model="item.val" placeholder="请选择时间" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"></j-date>
-                <a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
-                <a-input v-else v-model="item.val" placeholder="请输入值"/>
-              </a-col>
-
-              <a-col :span="4">
-                <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
-                <a-button @click="handleDel( index )" icon="minus"></a-button>
-              </a-col>
-
-            </a-row>
-
-          </a-form>
-        </a-col>
-        <a-col :sm="24" :md="5">
-          <!-- 查询记录 -->
-
-          <a-card class="j-super-query-history-card" :bordered="true">
-            <div slot="title">
-              保存的查询
-            </div>
-
-            <a-empty v-if="treeData.length === 0" class="j-super-query-history-empty" description="没有保存任何查询"/>
-            <a-tree
-              v-else
-              class="j-super-query-history-tree"
-              showIcon
-              :treeData="treeData"
-              @select="handleTreeSelect"
-              @rightClick="handleTreeRightClick"
-            >
-            </a-tree>
-          </a-card>
-
-
-        </a-col>
-      </a-row>
-
-
-    </a-spin>
-
-    <a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk">
-      <a-input v-model="prompt.value"></a-input>
-    </a-modal>
+                  <j-select-multi-user
+                    v-else-if="item.type === 'select-user'"
+                    v-model="item.val"
+                    :buttons="false"
+                    :multiple="false"
+                    placeholder="请选择用户"
+                    :returnKeys="['id', item.customReturnField || 'username']"
+                  />
+                  <j-select-depart
+                    v-else-if="item.type === 'select-depart'"
+                    v-model="item.val"
+                    :multi="false"
+                    placeholder="请选择部门"
+                    :customReturnField="item.customReturnField || 'id'"
+                  />
+                  <a-select v-else-if="item.options instanceof Array" v-model="item.val" :options="item.options" allowClear placeholder="请选择"/>
+                  <j-date v-else-if=" item.type=='date' " v-model="item.val" placeholder="请选择日期" style="width: 100%"></j-date>
+                  <j-date
+                    v-else-if=" item.type=='datetime' "
+                    v-model="item.val"
+                    placeholder="请选择时间"
+                    :show-time="true"
+                    date-format="YYYY-MM-DD HH:mm:ss"
+                    style="width: 100%"></j-date>
+                  <a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
+                  <a-input v-else v-model="item.val" placeholder="请输入值"/>
+                </a-col>
+
+                <a-col :span="4">
+                  <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
+                  <a-button @click="handleDel( index )" icon="minus"></a-button>
+                </a-col>
+
+              </a-row>
+
+            </a-form>
+          </a-col>
+          <a-col :sm="24" :md="5">
+            <!-- 查询记录 -->
+
+            <a-card class="j-super-query-history-card" :bordered="true">
+              <div slot="title">
+                保存的查询
+              </div>
+
+              <a-empty v-if="treeData.length === 0" class="j-super-query-history-empty" description="没有保存任何查询"/>
+              <a-tree
+                v-else
+                class="j-super-query-history-tree"
+                showIcon
+                :treeData="treeData"
+                @select="handleTreeSelect"
+                @rightClick="handleTreeRightClick"
+              >
+              </a-tree>
+            </a-card>
+
+          </a-col>
+        </a-row>
+
+      </a-spin>
+
+      <a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk">
+        <a-input v-model="prompt.value"></a-input>
+      </a-modal>
 
-  </a-modal>
-</div>
+    </a-modal>
+  </div>
 </template>
 
 <script>
-  import * as utils from '@/utils/util'
-  import JDate from '@/components/jeecg/JDate.vue'
-  import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
-  import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
+import * as utils from '@/utils/util'
+import JDate from '@/components/jeecg/JDate.vue'
+import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
+import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
 
-  export default {
+export default {
     name: 'JSuperQuery',
     components: { JDate, JSelectDepart, JSelectMultiUser },
     props: {
-      /*
+        /*
        fieldList: [{
           value:'',
           text:'',
@@ -188,236 +192,233 @@
        }]
        type:date datetime int number string
       * */
-      fieldList: {
-        type: Array,
-        required: true
-      },
-      /*
+        fieldList: {
+            type: Array,
+            required: true
+        },
+        /*
       * 这个回调函数接收一个数组参数 即查询条件
       * */
-      callback: {
-        type: String,
-        required: false,
-        default: 'handleSuperQuery'
-      },
-
-      // 当前是否在加载中
-      loading: {
-        type: Boolean,
-        default: false
-      },
-
-      // 保存查询条件的唯一 code,通过该 code 区分
-      saveCode: {
-        type: String,
-        default: 'testSaveCode'
-      }
-
-    },
-    data() {
-      return {
-        fieldTreeData: [],
+        callback: {
+            type: String,
+            required: false,
+            default: 'handleSuperQuery'
+        },
 
-        prompt: {
-          visible: false,
-          value: ''
+        // 当前是否在加载中
+        loading: {
+            type: Boolean,
+            default: false
         },
 
-        visible: false,
-        queryParamsModel: [{}],
-        treeIcon: <a-icon type="file-text"/>,
-        treeData: [],
-        // 保存查询条件的前缀名
-        saveCodeBefore: 'JSuperQuerySaved_',
-        selectValue: 'and',
-        superQueryFlag: false
-      }
+        // 保存查询条件的唯一 code,通过该 code 区分
+        saveCode: {
+            type: String,
+            default: 'testSaveCode'
+        }
+
     },
-    watch: {
-      // 当 saveCode 变化时,重新查询已保存的条件
-      saveCode: {
-        immediate: true,
-        handler(val) {
-          let list = this.$ls.get(this.saveCodeBefore + val)
-          if (list instanceof Array) {
-            this.treeData = list.map(item => {
-              item.icon = this.treeIcon
-              return item
-            })
-          }
+    data () {
+        return {
+            fieldTreeData: [],
+
+            prompt: {
+                visible: false,
+                value: ''
+            },
+
+            visible: false,
+            queryParamsModel: [{}],
+            treeIcon: <a-icon type="file-text"/>,
+            treeData: [],
+            // 保存查询条件的前缀名
+            saveCodeBefore: 'JSuperQuerySaved_',
+            selectValue: 'and',
+            superQueryFlag: false
         }
-      },
-      fieldList: {
-        deep: true,
-        immediate: true,
-        handler(val) {
-          let mainData = [], subData = []
-          val.forEach(item => {
-            let data = { ...item }
-            data.label = data.label || data.text
-            let hasChildren = (data.children instanceof Array)
-            data.disabled = hasChildren
-            data.selectable = !hasChildren
-            if (hasChildren) {
-              data.children = data.children.map(item2 => {
-                let child = { ...item2 }
-                child.label = child.label || child.text
-                child.label = data.label + '-' + child.label
-                child.value = data.value + ',' + child.value
-                child.val = ''
-                return child
-              })
-              data.val = ''
-              subData.push(data)
-            } else {
-              mainData.push(data)
+    },
+    watch: {
+        // 当 saveCode 变化时,重新查询已保存的条件
+        saveCode: {
+            immediate: true,
+            handler (val) {
+                let list = this.$ls.get(this.saveCodeBefore + val)
+                if (list instanceof Array) {
+                    this.treeData = list.map(item => {
+                        item.icon = this.treeIcon
+                        return item
+                    })
+                }
+            }
+        },
+        fieldList: {
+            deep: true,
+            immediate: true,
+            handler (val) {
+                let mainData = []; let subData = []
+                val.forEach(item => {
+                    let data = { ...item }
+                    data.label = data.label || data.text
+                    let hasChildren = (data.children instanceof Array)
+                    data.disabled = hasChildren
+                    data.selectable = !hasChildren
+                    if (hasChildren) {
+                        data.children = data.children.map(item2 => {
+                            let child = { ...item2 }
+                            child.label = child.label || child.text
+                            child.label = data.label + '-' + child.label
+                            child.value = data.value + ',' + child.value
+                            child.val = ''
+                            return child
+                        })
+                        data.val = ''
+                        subData.push(data)
+                    } else {
+                        mainData.push(data)
+                    }
+                })
+                this.fieldTreeData = mainData.concat(subData)
             }
-          })
-          this.fieldTreeData = mainData.concat(subData)
         }
-      }
     },
 
     methods: {
-      show() {
-        if (!this.queryParamsModel || this.queryParamsModel.length == 0) {
-          this.queryParamsModel = [{}]
-        }
-        this.visible = true
-      },
-      handleOk() {
-        if (!this.isNullArray(this.queryParamsModel)) {
-          let event = {
-            matchType: this.selectValue,
-            params: this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
-          }
-          console.log('---高级查询参数--->', event)
-          this.emitCallback(event.params, event.matchType)
-        } else {
-          this.emitCallback()
-        }
-      },
-      emitCallback(params, matchType) {
-        this.superQueryFlag = !!params
-        this.$emit(this.callback, params, matchType)
-      },
-      handleCancel() {
-        this.close()
-      },
-      close() {
-        this.$emit('close')
-        this.visible = false
-      },
-      handleAdd() {
-        this.queryParamsModel.push({})
-      },
-      handleDel(index) {
-        this.queryParamsModel.splice(index, 1)
-      },
-      handleSelected(node, item) {
-        let { type, options, dictCode, dictTable, customReturnField } = node.dataRef
-        item['type'] = type
-        item['options'] = options
-        item['dictCode'] = dictCode
-        item['dictTable'] = dictTable
-        item['customReturnField'] = customReturnField
-        this.$set(item, 'val', undefined)
-      },
-      handleReset() {
-        this.superQueryFlag = false
-        this.queryParamsModel = [{}]
-        this.emitCallback()
-      },
-      handleSave() {
-        let queryParams = this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
-        if (this.isNullArray(queryParams)) {
-          this.$message.warning('空条件不能保存')
-        } else {
-          this.prompt.value = ''
-          this.prompt.visible = true
-        }
-      },
-      handlePromptOk() {
-
-        let { value } = this.prompt
-        // 判断有没有重名
-
-        let filterList = this.treeData.filter(i => i.title === value)
-        if (filterList.length > 0) {
-          this.$confirm({
-            content: `${value} 已存在,是否覆盖?`,
-            onOk: () => {
-              this.prompt.visible = false
-              filterList[0].records = this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
-              this.saveToLocalStore()
-              this.$message.success('保存成功')
+        show () {
+            if (!this.queryParamsModel || this.queryParamsModel.length == 0) {
+                this.queryParamsModel = [{}]
             }
-          })
-        } else {
-          this.prompt.visible = false
-          this.treeData.push({
-            title: value,
-            icon: this.treeIcon,
-            records: this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
-          })
-          this.saveToLocalStore()
-          this.$message.success('保存成功')
-        }
+            this.visible = true
+        },
+        handleOk () {
+            if (!this.isNullArray(this.queryParamsModel)) {
+                let event = {
+                    matchType: this.selectValue,
+                    params: this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
+                }
+                console.log('---高级查询参数--->', event)
+                this.emitCallback(event.params, event.matchType)
+            } else {
+                this.emitCallback()
+            }
+        },
+        emitCallback (params, matchType) {
+            this.superQueryFlag = !!params
+            this.$emit(this.callback, params, matchType)
+        },
+        handleCancel () {
+            this.close()
+        },
+        close () {
+            this.$emit('close')
+            this.visible = false
+        },
+        handleAdd () {
+            this.queryParamsModel.push({})
+        },
+        handleDel (index) {
+            this.queryParamsModel.splice(index, 1)
+        },
+        handleSelected (node, item) {
+            let { type, options, dictCode, dictTable, customReturnField } = node.dataRef
+            item['type'] = type
+            item['options'] = options
+            item['dictCode'] = dictCode
+            item['dictTable'] = dictTable
+            item['customReturnField'] = customReturnField
+            this.$set(item, 'val', undefined)
+        },
+        handleReset () {
+            this.superQueryFlag = false
+            this.queryParamsModel = [{}]
+            this.emitCallback()
+        },
+        handleSave () {
+            let queryParams = this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
+            if (this.isNullArray(queryParams)) {
+                this.$message.warning('空条件不能保存')
+            } else {
+                this.prompt.value = ''
+                this.prompt.visible = true
+            }
+        },
+        handlePromptOk () {
+            let { value } = this.prompt
+            // 判断有没有重名
+
+            let filterList = this.treeData.filter(i => i.title === value)
+            if (filterList.length > 0) {
+                this.$confirm({
+                    content: `${value} 已存在,是否覆盖?`,
+                    onOk: () => {
+                        this.prompt.visible = false
+                        filterList[0].records = this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
+                        this.saveToLocalStore()
+                        this.$message.success('保存成功')
+                    }
+                })
+            } else {
+                this.prompt.visible = false
+                this.treeData.push({
+                    title: value,
+                    icon: this.treeIcon,
+                    records: this.removeEmptyObject(utils.cloneObject(this.queryParamsModel))
+                })
+                this.saveToLocalStore()
+                this.$message.success('保存成功')
+            }
+        },
+        handleTreeSelect (idx, event) {
+            if (event.selectedNodes[0]) {
+                this.queryParamsModel = utils.cloneObject(event.selectedNodes[0].data.props.records)
+            }
+        },
+        handleTreeRightClick (args) {
+            this.$confirm({
+                content: '是否删除当前查询?',
+                onOk: () => {
+                    let { node: { eventKey } } = args
+                    this.treeData.splice(Number.parseInt(eventKey.substring(2)), 1)
+                    this.saveToLocalStore()
+                    this.$message.success('删除成功')
+                }
+            })
+        },
 
+        // 将查询保存到 LocalStore 里
+        saveToLocalStore () {
+            this.$ls.set(this.saveCodeBefore + this.saveCode, this.treeData.map(item => {
+                return { title: item.title, records: item.records }
+            }))
+        },
 
-      },
-      handleTreeSelect(idx, event) {
-        if (event.selectedNodes[0]) {
-          this.queryParamsModel = utils.cloneObject(event.selectedNodes[0].data.props.records)
-        }
-      },
-      handleTreeRightClick(args) {
-        this.$confirm({
-          content: '是否删除当前查询?',
-          onOk: () => {
-            let { node: { eventKey } } = args
-            this.treeData.splice(Number.parseInt(eventKey.substring(2)), 1)
-            this.saveToLocalStore()
-            this.$message.success('删除成功')
-          },
-        })
-      },
-
-      // 将查询保存到 LocalStore 里
-      saveToLocalStore() {
-        this.$ls.set(this.saveCodeBefore + this.saveCode, this.treeData.map(item => {
-          return { title: item.title, records: item.records }
-        }))
-      },
-
-      isNullArray(array) {
-        //判断是不是空数组对象
-        if (!array || array.length === 0) {
-          return true
-        }
-        if (array.length === 1) {
-          let obj = array[0]
-          if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) {
-            return true
-          }
-        }
-        return false
-      },
-      // 去掉数组中的空对象
-      removeEmptyObject(array) {
-        for (let i = 0; i < array.length; i++) {
-          let item = array[i]
-          if (item == null || Object.keys(item).length <= 0) {
-            array.splice(i--, 1)
-          } else {
-            // 去掉特殊属性
-            delete item.options
-          }
+        isNullArray (array) {
+        // 判断是不是空数组对象
+            if (!array || array.length === 0) {
+                return true
+            }
+            if (array.length === 1) {
+                let obj = array[0]
+                if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) {
+                    return true
+                }
+            }
+            return false
+        },
+        // 去掉数组中的空对象
+        removeEmptyObject (array) {
+            for (let i = 0; i < array.length; i++) {
+                let item = array[i]
+                if (item == null || Object.keys(item).length <= 0) {
+                    array.splice(i--, 1)
+                } else {
+                    // 去掉特殊属性
+                    delete item.options
+                }
+            }
+            return array
         }
-        return array
-      }
     }
-  }
+}
 </script>
 
 <style lang="less" scoped>
@@ -470,4 +471,4 @@
 
   }
 
-</style>
+</style>

+ 307 - 307
src/mixins/JeecgListMixin.js

@@ -3,322 +3,322 @@
  * 高级查询按钮调用 superQuery方法  高级查询组件ref定义为superQueryModal
  * data中url定义 list为查询列表  delete为删除单条记录  deleteBatch为批量删除
  */
-import { filterObj } from '@/utils/util';
-import { deleteAction, getAction,downFile } from '@/api/manage'
+import { filterObj } from '@/utils/util'
+import { deleteAction, getAction, downFile } from '@/api/manage'
 import Vue from 'vue'
-import { ACCESS_TOKEN } from "@/store/mutation-types"
+import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 export const JeecgListMixin = {
-  data(){
-    return {
-      //token header
-      tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
-      /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
-      queryParam: {},
-      /* 数据源 */
-      dataSource:[],
-      /* 分页参数 */
-      ipagination:{
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '20', '30'],
-        showTotal: (total, range) => {
-          return range[0] + "-" + range[1] + " 共" + total + "条"
-        },
-        showQuickJumper: true,
-        showSizeChanger: true,
-        total: 0
-      },
-      /* 排序参数 */
-      isorter:{
-        column: 'createTime',
-        order: 'desc',
-      },
-      /* 筛选参数 */
-      filters: {},
-      /* table加载状态 */
-      loading:false,
-      /* table选中keys*/
-      selectedRowKeys: [],
-      /* table选中records*/
-      selectionRows: [],
-      /* 查询折叠 */
-      toggleSearchStatus:false,
-      /* 高级查询条件生效状态 */
-      superQueryFlag:false,
-      /* 高级查询条件 */
-      superQueryParams:""
-    }
-  },
-  computed:{
-    scroll:function(){
-      var width = window.innerWidth;
-      //ant-table
-      let $antTable = window.document.getElementsByClassName("ant-table");
-      if ($antTable[0]){
-        width = $antTable[0].clientWidth;
-      }
-      console.log("$antTable",$antTable)
-      return {
-          // x:'max-content',
-          x:width,
-          y:window.innerHeight/2,
-      }
-    },
-    innerHeight:function(){
-      var innerHeight = window.innerHeight;
-      return  innerHeight;
-    },
-  },
-  created() {
-    if(!this.disableMixinCreated){
-      console.log(' -- mixin created -- ')
-      this.loadData();
-      //初始化字典配置 在自己页面定义
-      this.initDictConfig();
-    }
-  },
-  methods:{
-    loadData(arg) {
-      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)
+    data () {
+        return {
+            // token header
+            tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
+            /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
+            queryParam: {},
+            /* 数据源 */
+            dataSource: [],
+            /* 分页参数 */
+            ipagination: {
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                    return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0
+            },
+            /* 排序参数 */
+            isorter: {
+                column: 'createTime',
+                order: 'desc'
+            },
+            /* 筛选参数 */
+            filters: {},
+            /* table加载状态 */
+            loading: false,
+            /* table选中keys */
+            selectedRowKeys: [],
+            /* table选中records */
+            selectionRows: [],
+            /* 查询折叠 */
+            toggleSearchStatus: false,
+            /* 高级查询条件生效状态 */
+            superQueryFlag: false,
+            /* 高级查询条件 */
+            superQueryParams: ''
         }
-        this.loading = false;
-      })
-    },
-    initDictConfig(){
-      console.log("--这是一个假的方法!")
-    },
-    handleSuperQuery(arg) {
-      //高级查询方法
-      if(!arg){
-        this.superQueryParams=''
-        this.superQueryFlag = false
-      }else{
-        this.superQueryFlag = true
-        this.superQueryParams=JSON.stringify(arg)
-      }
-      this.loadData()
-    },
-    getQueryParams() {
-      //获取查询条件
-      let sqp = {}
-      if(this.superQueryParams){
-        sqp['superQueryParams']=encodeURI(this.superQueryParams)
-      }
-      var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
-      param.field = this.getQueryField();
-      param.pageNo = this.ipagination.current;
-      param.pageSize = this.ipagination.pageSize;
-      return filterObj(param);
-    },
-    getQueryField() {
-      //TODO 字段权限控制
-      var str = "id,";
-      this.columns.forEach(function (value) {
-        str += "," + value.dataIndex;
-      });
-      return str;
-    },
-
-    onSelectChange(selectedRowKeys, selectionRows) {
-      this.selectedRowKeys = selectedRowKeys;
-      this.selectionRows = selectionRows;
-    },
-    onClearSelected() {
-      this.selectedRowKeys = [];
-      this.selectionRows = [];
-    },
-    searchQuery() {
-      this.loadData(1);
-    },
-    superQuery() {
-      this.$refs.superQueryModal.show();
     },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1);
-    },
-    batchDel: function () {
-      if(!this.url.deleteBatch){
-        this.$message.error("请设置url.deleteBatch属性!")
-        return
-      }
-      if (this.selectedRowKeys.length <= 0) {
-        this.$message.warning('请选择一条记录!');
-        return;
-      } else {
-        var ids = "";
-        for (var a = 0; a < this.selectedRowKeys.length; a++) {
-          ids += this.selectedRowKeys[a] + ",";
-        }
-        var that = this;
-        this.$confirm({
-          title: "确认删除",
-          content: "是否删除选中数据?",
-          onOk: function () {
-            that.loading = true;
-            deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
-              if (res.success) {
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              } else {
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.loading = false;
-            });
-          }
-        });
-      }
-    },
-    handleDelete: function (id) {
-      if(!this.url.delete){
-        this.$message.error("请设置url.delete属性!")
-        return
-      }
-      var that = this;
-      deleteAction(that.url.delete, {id: id}).then((res) => {
-        if (res.success) {
-          that.$message.success(res.message);
-          that.loadData();
-        } else {
-          that.$message.warning(res.message);
+    computed: {
+        scroll: function () {
+            var width = window.innerWidth
+            // ant-table
+            let $antTable = window.document.getElementsByClassName('ant-table')
+            if ($antTable[0]) {
+                width = $antTable[0].clientWidth
+            }
+            console.log('$antTable', $antTable)
+            return {
+                // x:'max-content',
+                x: width,
+                y: window.innerHeight / 2
+            }
+        },
+        innerHeight: function () {
+            var innerHeight = window.innerHeight
+            return innerHeight
         }
-      });
-    },
-    handleEdit: function (record) {
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title = "编辑";
-      this.$refs.modalForm.disableSubmit = false;
-    },
-    handleAdd: function () {
-      this.$refs.modalForm.add();
-      this.$refs.modalForm.title = "新增";
-      this.$refs.modalForm.disableSubmit = false;
-    },
-    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();
     },
-    handleToggleSearch(){
-      this.toggleSearchStatus = !this.toggleSearchStatus;
-    },
-    modalFormOk() {
-      // 新增/修改 成功时,重载列表
-      this.loadData();
-    },
-    handleDetail:function(record){
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title="详情";
-      this.$refs.modalForm.disableSubmit = true;
-    },
-    /* 导出 */
-    handleExportXls2(){
-      let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
-      let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
-      window.location.href = url;
-    },
-    handleExportXls(fileName){
-      if(!fileName || typeof fileName != "string"){
-        fileName = "导出文件"
-      }
-      let param = {...this.queryParam};
-      if(this.selectedRowKeys && this.selectedRowKeys.length>0){
-        param['selections'] = this.selectedRowKeys.join(",")
-      }
-      console.log("导出参数",param)
-      downFile(this.url.exportXlsUrl,param).then((data)=>{
-        if (!data) {
-          this.$message.warning("文件下载失败")
-          return
+    created () {
+        if (!this.disableMixinCreated) {
+            // console.log(' -- mixin created -- ')
+            this.loadData()
+            // 初始化字典配置 在自己页面定义
+            this.initDictConfig()
         }
-        if (typeof window.navigator.msSaveBlob !== 'undefined') {
-          window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
-        }else{
-          let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
-          let link = document.createElement('a')
-          link.style.display = 'none'
-          link.href = url
-          link.setAttribute('download', fileName+'.xls')
-          document.body.appendChild(link)
-          link.click()
-          document.body.removeChild(link); //下载完成移除元素
-          window.URL.revokeObjectURL(url); //释放掉blob对象
-        }
-      })
     },
-    /* 导入 */
-    handleImportExcel(info){
-      if (info.file.status !== 'uploading') {
-        console.log(info.file, info.fileList);
-      }
-      if (info.file.status === 'done') {
-        if (info.file.response.success) {
-          // this.$message.success(`${info.file.name} 文件上传成功`);
-          if (info.file.response.code === 201) {
-            let { message, result: { msg, fileUrl, fileName } } = info.file.response
-            let href = window._CONFIG['domianURL'] + fileUrl
-            this.$warning({
-              title: message,
-              content: (
-                <div>
-                  <span>{msg}</span><br/>
-                  <span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
-                </div>
-              )
+    methods: {
+        loadData (arg) {
+            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
+            })
+        },
+
+        initDictConfig () {
+            // console.log('--这是一个假的方法!')
+        },
+        handleSuperQuery (arg) {
+            // 高级查询方法
+            if (!arg) {
+                this.superQueryParams = ''
+                this.superQueryFlag = false
+            } else {
+                this.superQueryFlag = true
+                this.superQueryParams = JSON.stringify(arg)
+            }
+            this.loadData()
+        },
+        getQueryParams () {
+            // 获取查询条件
+            let sqp = {}
+            if (this.superQueryParams) {
+                sqp['superQueryParams'] = encodeURI(this.superQueryParams)
+            }
+            var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
+            param.field = this.getQueryField()
+            param.pageNo = this.ipagination.current
+            param.pageSize = this.ipagination.pageSize
+            return filterObj(param)
+        },
+        getQueryField () {
+            // TODO 字段权限控制
+            var str = 'id,'
+            this.columns.forEach(function (value) {
+                str += ',' + value.dataIndex
             })
-          } else {
-            this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
-          }
-          this.loadData()
-        } else {
-          this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+            return str
+        },
+
+        onSelectChange (selectedRowKeys, selectionRows) {
+            this.selectedRowKeys = selectedRowKeys
+            this.selectionRows = selectionRows
+        },
+        onClearSelected () {
+            this.selectedRowKeys = []
+            this.selectionRows = []
+        },
+        searchQuery () {
+            this.loadData(1)
+        },
+        superQuery () {
+            this.$refs.superQueryModal.show()
+        },
+        searchReset () {
+            this.queryParam = {}
+            this.loadData(1)
+        },
+        batchDel: function () {
+            if (!this.url.deleteBatch) {
+                this.$message.error('请设置url.deleteBatch属性!')
+                return
+            }
+            if (this.selectedRowKeys.length <= 0) {
+                this.$message.warning('请选择一条记录!')
+            } else {
+                var ids = ''
+                for (var a = 0; a < this.selectedRowKeys.length; a++) {
+                    ids += this.selectedRowKeys[a] + ','
+                }
+                var that = this
+                this.$confirm({
+                    title: '确认删除',
+                    content: '是否删除选中数据?',
+                    onOk: function () {
+                        that.loading = true
+                        deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
+                            if (res.success) {
+                                that.$message.success(res.message)
+                                that.loadData()
+                                that.onClearSelected()
+                            } else {
+                                that.$message.warning(res.message)
+                            }
+                        }).finally(() => {
+                            that.loading = false
+                        })
+                    }
+                })
+            }
+        },
+        handleDelete: function (id) {
+            if (!this.url.delete) {
+                this.$message.error('请设置url.delete属性!')
+                return
+            }
+            var that = this
+            deleteAction(that.url.delete, { id: id }).then((res) => {
+                if (res.success) {
+                    that.$message.success(res.message)
+                    that.loadData()
+                } else {
+                    that.$message.warning(res.message)
+                }
+            })
+        },
+        handleEdit: function (record) {
+            this.$refs.modalForm.edit(record)
+            this.$refs.modalForm.title = '编辑'
+            this.$refs.modalForm.disableSubmit = false
+        },
+        handleAdd: function () {
+            this.$refs.modalForm.add()
+            this.$refs.modalForm.title = '新增'
+            this.$refs.modalForm.disableSubmit = false
+        },
+        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.ipagination = pagination
+            this.loadData()
+        },
+        handleToggleSearch () {
+            this.toggleSearchStatus = !this.toggleSearchStatus
+        },
+        modalFormOk () {
+            // 新增/修改 成功时,重载列表
+            this.loadData()
+        },
+        handleDetail: function (record) {
+            this.$refs.modalForm.edit(record)
+            this.$refs.modalForm.title = '详情'
+            this.$refs.modalForm.disableSubmit = true
+        },
+        /* 导出 */
+        handleExportXls2 () {
+            let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()))
+            let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`
+            window.location.href = url
+        },
+        handleExportXls (fileName) {
+            if (!fileName || typeof fileName !== 'string') {
+                fileName = '导出文件'
+            }
+            let param = { ...this.queryParam }
+            if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
+                param['selections'] = this.selectedRowKeys.join(',')
+            }
+            console.log('导出参数', param)
+            downFile(this.url.exportXlsUrl, param).then((data) => {
+                if (!data) {
+                    this.$message.warning('文件下载失败')
+                    return
+                }
+                if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                    window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+                } else {
+                    let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+                    let link = document.createElement('a')
+                    link.style.display = 'none'
+                    link.href = url
+                    link.setAttribute('download', fileName + '.xls')
+                    document.body.appendChild(link)
+                    link.click()
+                    document.body.removeChild(link) // 下载完成移除元素
+                    window.URL.revokeObjectURL(url) // 释放掉blob对象
+                }
+            })
+        },
+        /* 导入 */
+        handleImportExcel (info) {
+            if (info.file.status !== 'uploading') {
+                console.log(info.file, info.fileList)
+            }
+            if (info.file.status === 'done') {
+                if (info.file.response.success) {
+                    // this.$message.success(`${info.file.name} 文件上传成功`);
+                    if (info.file.response.code === 201) {
+                        let { message, result: { msg, fileUrl, fileName } } = info.file.response
+                        let href = window._CONFIG['domianURL'] + fileUrl
+                        this.$warning({
+                            title: message,
+                            content: (
+                                <div>
+                                    <span>{msg}</span><br/>
+                                    <span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
+                                </div>
+                            )
+                        })
+                    } else {
+                        this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
+                    }
+                    this.loadData()
+                } else {
+                    this.$message.error(`${info.file.name} ${info.file.response.message}.`)
+                }
+            } else if (info.file.status === 'error') {
+                this.$message.error(`文件上传失败: ${info.file.msg} `)
+            }
+        },
+        /* 图片预览 */
+        getImgView (text) {
+            if (text && text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            return window._CONFIG['staticDomainURL'] + '/' + text
+        },
+        /* 文件下载 */
+        uploadFile (text) {
+            if (!text) {
+                this.$message.warning('未知的文件')
+                return
+            }
+            if (text.indexOf(',') > 0) {
+                text = text.substring(0, text.indexOf(','))
+            }
+            window.open(window._CONFIG['staticDomainURL'] + '/' + text)
         }
-      } else if (info.file.status === 'error') {
-        this.$message.error(`文件上传失败: ${info.file.msg} `);
-      }
-    },
-    /* 图片预览 */
-    getImgView(text){
-      if(text && text.indexOf(",")>0){
-        text = text.substring(0,text.indexOf(","))
-      }
-      return window._CONFIG['staticDomainURL']+"/"+text
-    },
-    /* 文件下载 */
-    uploadFile(text){
-      if(!text){
-        this.$message.warning("未知的文件")
-        return;
-      }
-      if(text.indexOf(",")>0){
-        text = text.substring(0,text.indexOf(","))
-      }
-      window.open(window._CONFIG['staticDomainURL']+ "/"+text);
-    },
-  }
+    }
 
-}
+}

+ 2 - 0
src/views/activiti/historicDetail.vue

@@ -6,6 +6,7 @@
       <p slot="title">
         <span>流程审批进度历史</span>
       </p>
+
       <a-row style="position:relative">
         <a-table
           :loading="loading"
@@ -69,6 +70,7 @@
         </a-table>
       </a-row>
     </a-card>
+
     <a-card>
       <p slot="title">
         <span>实时流程图</span>

+ 0 - 336
src/views/user/1111111111.vue

@@ -1,336 +0,0 @@
-<template>
-  <div class="orderAll">
-    <my-header>订单</my-header>
-    <!-- Tab 标签栏---------------------------------------
-          1. v-model="billStatus" 绑定一个值, 指定当前激活的tab栏的下标, 下标0开始
-          2. sticky 吸顶粘性布局
-          3. animated 切换动画
-          4. swipeable 滑动切换效果
-
-          下拉刷新
-          v-model 设置为 false,表示加载完成
-     ----------------------------------------------------------->
-    <div class="state-tabs">
-      <van-tabs
-        v-model="billStatus"
-        @click.native="handleClick"
-        sticky
-        animated
-        swipeable
-      >
-        <!-- 待完成 -->
-        <van-tab title="待完成" name="wait">
-          <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
-            <div
-              class="wait wait1"
-              v-for="item in orders"
-              :key="item.orderId"
-              @click="orderDetail(item.orderType, item.orderId)"
-            >
-              <div class="title">
-                <h4 v-if="item.orderType == 'caiOrder'">
-                  采血任务
-                </h4>
-                <h4 v-if="item.orderType == 'huiOrder'">
-                  回输任务
-                </h4>
-                <span class="waitState">{{ item.nodeName }}</span>
-              </div>
-
-              <!-- 详细内容 -------------------------->
-              <div class="details">
-                <!-- 订单号 -->
-                <div class="row clearfix">
-                  <span class="fl">订单号</span>
-                  <em class="num fr">{{ item.billNo }}</em>
-                </div>
-                <!-- 订单日期 -->
-                <div class="row clearfix">
-                  <span class="fl">订单日期</span>
-                  <em class="startTime fr">{{ item.billDate }}</em>
-                </div>
-                <!-- 采血提货时间 -->
-                <div class="row clearfix">
-                  <span class="fl">提货时间</span>
-                  <em class="scheduledTime fr ">{{ item.pickTime }}</em>
-                </div>
-                <!-- 提货点 -->
-                <div class="row clearfix">
-                  <span class="fl">提货点</span>
-                  <em class="place fr">{{ item.pickPoint }}</em>
-                </div>
-                <!-- 提货地址 -->
-                <div class="row clearfix">
-                  <span class="fl">提货地址</span>
-                  <em class="place fr">{{ item.pickAddr }}</em>
-                </div>
-                <!-- 送达点 -->
-                <div class="row clearfix">
-                  <span class="fl">送达点</span>
-                  <em class="place fr">{{ item.deliveryPoint }}</em>
-                </div>
-                <!-- 送达地址 -->
-                <div class="row clearfix">
-                  <span class="fl">送达地址</span>
-                  <em class="place fr">{{ item.deliveryAddr }}</em>
-                </div>
-
-                <!-- 联系人 -->
-                <div class="row clearfix person">
-                  <span>联系人</span>
-                  <em class="who ">{{ item.pickPsn }}</em>
-                  <div class="phoneNum fr">{{ item.pickTel }}</div>
-                </div>
-              </div>
-            </div>
-          </van-pull-refresh>
-        </van-tab>
-
-        <!-- 完成 -->
-        <van-tab title="完成" name="completed">
-          <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
-            <div
-              class="completed completed1"
-              v-for="item in orders"
-              :key="item.orderId"
-              @click="orderDetail(item.orderType, item.orderId)"
-            >
-
-              <!-- 标题 -->
-              <div class="title com">
-                <h4 v-if="item.orderType == 'caiOrder'">
-                  采血任务
-                </h4>
-                <h4 v-if="item.orderType == 'huiOrder'">
-                  回输任务
-                </h4>
-                <span class="completedState">{{ item.nodeName }}</span>
-              </div>
-
-              <!-- 细节 -->
-              <div class="details">
-                <!-- 订单号 -->
-                <div class="row clearfix">
-                  <span class="fl">订单号</span>
-                  <em class="num fr">{{ item.billNo }}</em>
-                </div>
-                <!-- 订单日期 -->
-                <div class="row clearfix">
-                  <span class="fl">订单日期</span>
-                  <em class="startTime fr">{{ item.billDate }}</em>
-                </div>
-                <!-- 采血提货时间 -->
-                <div class="row clearfix">
-                  <span class="fl">提货时间</span>
-                  <em class="scheduledTime fr ">{{ item.pickTime }}</em>
-                </div>
-                <!-- 提货点 -->
-                <div class="row clearfix">
-                  <span class="fl">提货点</span>
-                  <em class="place fr">{{ item.pickPoint }}</em>
-                </div>
-                <!-- 提货地址 -->
-                <div class="row clearfix">
-                  <span class="fl">提货地址</span>
-                  <em class="place fr">{{ item.pickAddr }}</em>
-                </div>
-                <!-- 送达点 -->
-                <div class="row clearfix">
-                  <span class="fl">送达点</span>
-                  <em class="place fr">{{ item.deliveryPoint }}</em>
-                </div>
-                <!-- 送达地址 -->
-                <div class="row clearfix">
-                  <span class="fl">送达地址</span>
-                  <em class="place fr">{{ item.deliveryAddr }}</em>
-                </div>
-
-                <!-- 联系人 -->
-                <div class="row clearfix person">
-                  <span>联系人</span>
-                  <em class="who ">{{ item.pickPsn }}</em>
-                  <div class="phoneNum fr">{{ item.pickTel }}</div>
-                </div>
-              </div>
-            </div>
-          </van-pull-refresh>
-        </van-tab>
-
-        <!-- 全部任务 -->
-        <van-tab title="全部" name="all">
-          <div class="all">
-            <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
-              <div
-                class="wait wait1"
-                v-for="item in orders"
-                :key="item.orderId"
-                @click="orderDetail(item.orderType, item.orderId)"
-              >
-                <!-- 通过判断附加class 属性 -->
-                <div
-                  class="title"
-                  :class="{ com: item.billStatus === ' 4' }"
-                >
-                  <h4 v-if="item.orderType == 'caiOrder'">
-                    采血任务
-                  </h4>
-                  <h4 v-if="item.orderType == 'huiOrder'">
-                    回输任务
-                  </h4>
-                  <span
-                    :class="{
-                      waitState: item.billStatus === '2',
-                      completedState: item.billStatus === ' 4'
-                    }"
-                  >{{ item.nodeName }}</span
-                  >
-                </div>
-
-                <div class="details">
-                  <!-- 订单号 -->
-                  <div class="row clearfix">
-                    <span class="fl">订单号</span>
-                    <em class="num fr">{{ item.billNo }}</em>
-                  </div>
-                  <!-- 订单日期 -->
-                  <div class="row clearfix">
-                    <span class="fl">订单日期</span>
-                    <em class="startTime fr">{{ item.billDate }}</em>
-                  </div>
-                  <!-- 提货时间 -->
-                  <div class="row clearfix">
-                    <span class="fl">提货时间</span>
-                    <em class="scheduledTime fr ">{{ item.pickTime }}</em>
-                  </div>
-                  <!-- 提货点 -->
-                  <div class="row clearfix">
-                    <span class="fl">提货点</span>
-                    <em class="place fr">{{ item.pickPoint }}</em>
-                  </div>
-                  <!-- 提货地址 -->
-                  <div class="row clearfix">
-                    <span class="fl">提货地址</span>
-                    <em class="place fr">{{ item.pickAddr }}</em>
-                  </div>
-                  <!-- 送达点 -->
-                  <div class="row clearfix">
-                    <span class="fl">送达点</span>
-                    <em class="place fr">{{ item.deliveryPoint }}</em>
-                  </div>
-                  <!-- 送达地址 -->
-                  <div class="row clearfix">
-                    <span class="fl">送达地址</span>
-                    <em class="place fr">{{ item.deliveryAddr }}</em>
-                  </div>
-
-                  <!-- 联系人 -->
-                  <div class="row clearfix person">
-                    <span>联系人</span>
-                    <em class="who ">{{ item.pickPsn }}</em>
-                    <div class="phoneNum fr">{{ item.pickTel }}</div>
-                  </div>
-                </div>
-              </div>
-            </van-pull-refresh>
-          </div>
-        </van-tab>
-      </van-tabs>
-    </div>
-
-    <!-- 底部 -->
-    <div class="footer">
-      <ul>
-        <li>
-          <div @click="$router.push('/')">
-            <i class="el-icon-s-home big"></i>
-            <p>首页</p>
-          </div>
-        </li>
-
-        <li>
-          <div>
-            <i class="el-icon-s-order current"></i>
-            <p class="current">订单</p>
-          </div>
-        </li>
-        <li>
-          <div @click="$router.push('/my')">
-            <i class="el-icon-s-custom"></i>
-            <p>我的</p>
-          </div>
-        </li>
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-    data () {
-        return {
-            orders: [], // 默认值给一个空对象
-            billStatus: 'all', // 默认全部页签
-            count: 0,
-            isLoading: false,
-            resultClass: { wait: 'waitState', completed: 'completedState' }
-        }
-    },
-    created () {
-    // 第一时间渲染列表
-        const { billStatus } = this.$route.params
-        this.billStatus = billStatus
-        if (billStatus) {
-            this.getOrders(this.billStatus)
-        }
-    },
-    methods: {
-    // tabs切换
-        handleClick () {
-            console.log(this.billStatus)
-            this.getOrders(this.billStatus)
-        },
-        async getOrders (billStatus) {
-            // 从本地获取用户 id 和 token
-            const deptId = localStorage.getItem('dept_id')
-            // 发送获取个人信息的请求时,需要携带上token令牌,需要放在请求头Authorization字段上
-            const res = await this.$axios.get(`/orders/${deptId}/${billStatus}`)
-            console.log(res)
-            const { statusCode, data } = res.data
-            if (statusCode === 200) {
-                this.orders = data
-            }
-        },
-        orderDetail (orderType, orderId) {
-            this.$router.push({
-                name: orderType,
-                params: {
-                    orderId: orderId
-                }
-            })
-        },
-        // 下拉刷新
-        onRefresh () {
-            setTimeout(() => {
-                this.$toast('刷新成功')
-                this.isLoading = false
-                this.getOrders(this.billStatus)
-            }, 1000)
-        }
-    }
-}
-</script>
-
-<style lang="less" scoped>
-.orderAll {
-  height: 100%;
-  // 单个订单
-  .wait1,
-  .completed1,
-  .completed2 {
-    border-radius: 7px;
-    padding: 10px;
-    box-shadow: 2px 2px 10px rgba(121, 118, 116, 0.4);
-    margin: 20px 20px;
-  }
-}
-</style>

+ 21 - 23
src/views/user/Login.vue

@@ -113,7 +113,7 @@ export default {
     // 进入页面自动登录
     this.autoLogin()
       .then(res => {
-        this.getDataList() // 所有列表(待办、已办)
+        this.getDataList() // 待办、已办 列表
       })
       .then(res => {
         this.getActiveKeyAll() // OA 4个按钮
@@ -121,9 +121,9 @@ export default {
   },
 
   methods: {
-    init() {
-      this.getDataList()
-    },
+    // init() {
+    //   this.getDataList()
+    // },
     // 映射store/user.js 中 actions的方法
     ...mapActions(['Login']),
 
@@ -134,12 +134,12 @@ export default {
       loginParams.username = 'fenghf'
       loginParams.password = 'fenghf`123456'
       loginParams.slidered = true // 默认滑块
-      console.log('打印出登录参数', loginParams)
+      // console.log('打印出登录参数', loginParams)
       // 异步操作
       await that
         .Login(loginParams)
         .then(res => {
-          console.log('Login页面拿到token、真正登录上啦!!!!')
+          console.log('Login拿到token | 登录上啦!')
         })
         .catch(err => {
           console.log(err)
@@ -150,33 +150,31 @@ export default {
     todo() {
       this.$router.push({ path: '/user/todo' })
       console.log(this.$router)
-      this.getDataList()
     },
 
-    // 拿到 消息数量
+    // 待办 num
     getDataList() {
-      //待办列表
       this.postFormAction(this.url.todoList, {}).then(res => {
         if (res.success) {
           this.todoList = res.result || []
-          console.log('登录页待办数量:', this.todoList.length)
+          console.log('login 待办num:', this.todoList.length)
           if (this.todoList && this.todoList.length > 0) {
             this.isshow = '1'
           } else {
             this.isshow = '2'
           }
         }
-      }),
-        // 已办列表
-        this.postFormAction(this.url.doneList, this.searchForm).then(res => {
-          this.loading = false
-          if (res.success) {
-            this.doneList = res.result || []
-            console.log('已渲染到已办数目', this.doneList.length)
-          } else {
-            this.$message.error(res.message)
-          }
-        })
+      })
+      // 已办列表
+      // this.postFormAction(this.url.doneList, this.searchForm).then(res => {
+      // this.loading = false
+      // if (res.success) {
+      //   this.doneList = res.result || []
+      //   console.log('已渲染到已办数目', this.doneList.length)
+      // } else {
+      //   this.$message.error(res.message)
+      // }
+      // })
     },
 
     // 获取 OA 按钮
@@ -189,7 +187,7 @@ export default {
             this.activeKeyAll = result
             // this.activeKeyAll.push.apply(this.activeKeyAll,result);
             // console.log(this.activeKeyAll)
-            console.log('OA 4个按钮', result)
+            console.log('OA 4个按钮被渲染')
           }
         }
       })
@@ -224,7 +222,7 @@ export default {
       }
       console.log('发起', v)
 
-      this.getDataList()
+      // this.getDataList()
     },
 
     //提交后

+ 46 - 41
src/views/user/Todo.vue

@@ -2,13 +2,13 @@
   <div class="content">
     <div class="main">
       <a-layout-header class="Header">
-        <a-icon type="left" @click="$router.go(-1)" style="fontSize:24px;color:white;marginLeft:2%;" />
+        <a-icon type="left" @click="$router.go(-1)" style="fontSize:22px;color:rgba(52, 123, 152);" />
         <span>我的事项</span>
       </a-layout-header>
 
       <!-- tabs 部分 -->
       <a-layout-content class="todoBody">
-        <a-tabs default-active-key="wait" @change="callback" class="todoPage">
+        <a-tabs default-active-key="wait" @change="tabClick" class="todoPage">
           <!-- 我的申请 -->
           <a-tab-pane key="apply" tab="申请" class="apply">
             <div v-for="item in applyList" :key="item.id">
@@ -160,7 +160,7 @@ export default {
                 if (res.success) {
                     this.todoList = res.result || []
                     this.total = this.data.leading
-                    console.log('大页面渲染待办列表1次', this.todoList)
+                    console.log('1次 todo.vue 待办列表', this.todoList)
                 }
             })
             // 已办
@@ -168,7 +168,7 @@ export default {
                 this.loading = false
                 if (res.success) {
                     this.doneList = res.result || []
-                    console.log('大页面渲染已办列表1次', this.doneList)
+                    console.log('1次 todo.vue 已办列表', this.doneList)
                 } else {
                     this.$message.error(res.message)
                 }
@@ -191,56 +191,56 @@ export default {
             }
         },
 
-        // 切换tabs值  原始
-        // callback (key) {
-        //     console.log(key)
-        //     if (key === 'apply') {
-        //         getAction(this.url.list).then(res => {
-        //             if (res.success) {
-        //                 this.applyList = res.result || []
-        //                 console.log('我的申请', this.applyList)
-        //             }
-        //         })
-        //     }
-        //     if (key === 'done') {
-        //         getAction(this.url.doneList).then(res => {
-        //             if (res.success) {
-        //                 this.doneList = res.result || []
-        //                 console.log('我的已办', this.doneList)
-        //             }
-        //         })
-        //     }
-        //     if (key === 'wait') {
-        //         getAction(this.url.todoList).then(res => {
-        //             if (res.success) {
-        //                 this.todoList = res.result || []
-        //                 console.log('我的申请', this.todoList)
-        //             }
-        //         })
-        //     }
-        // }
-        // 切换tabs值
-        callback (key) {
+        // tab被点击的回调 原始
+        tabClick (key) {
             console.log(key)
             if (key === 'apply') {
                 getAction(this.url.list).then(res => {
                     if (res.success) {
                         this.applyList = res.result || []
-                        console.log('大页面渲染申请列表', this.applyList)
+                        console.log('申请列表:', this.applyList)
                     }
                 })
             }
             if (key === 'done') {
-                var what1 = [{ applyer: '123123132' }]
-                this.doneList = what1
-                console.log('大页面渲染已办列表', this.doneList)
+                getAction(this.url.doneList).then(res => {
+                    if (res.success) {
+                        this.doneList = res.result || []
+                        console.log('已办列表:', this.doneList)
+                    }
+                })
             }
             if (key === 'wait') {
-                var what2 = [{ applyer: '123123132' }]
-                this.todoList = what2
-                console.log('大页面渲染待办列表2次', this.todoList)
+                getAction(this.url.todoList).then(res => {
+                    if (res.success) {
+                        this.todoList = res.result || []
+                        console.log('申请列表:', this.todoList)
+                    }
+                })
             }
         }
+    // tab被点击的回调 修改
+    // callback (key) {
+    //     console.log(key)
+    //     if (key === 'apply') {
+    //         getAction(this.url.list).then(res => {
+    //             if (res.success) {
+    //                 this.applyList = res.result || []
+    //                 console.log('1次 todo 申请列表', this.applyList)
+    //             }
+    //         })
+    //     }
+    //     if (key === 'done') {
+    //         var what1 = [{ applyer: '123123132' }]
+    //         this.doneList = what1
+    //         console.log('3次 todo页面 已完成', this.doneList)
+    //     }
+    //     if (key === 'wait') {
+    //         var what2 = [{ applyer: '123123132' }]
+    //         this.todoList = what2
+    //         console.log('3次 todo页面 待办', this.todoList)
+    //     }
+    // }
     }
 }
 </script>
@@ -253,6 +253,11 @@ export default {
 .content {
   .main {
     padding: 14px;
+    /deep/.ant-tabs {
+      // background-color: rgb(12, 120, 153);
+      border-top-left-radius: 40px;
+      border-top-right-radius: 40px;
+    }
   }
 }
 </style>

+ 42 - 15
src/views/user/tabs/ApplyTab.vue

@@ -83,7 +83,7 @@
             <a-button
               class="itemBtn"
               ghost
-              @click="applyEdit(item)"
+              @click="edit(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
                       color:orange;"
             >
@@ -93,7 +93,7 @@
             <a-button
               class="itemBtn"
               ghost
-              @click="applyRemove(item)"
+              @click="remove(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
                       color:#4e73b9;"
             >
@@ -115,11 +115,11 @@
             <a-button
               class="itemBtn"
               ghost
-              @click="detail(item)"
+              @click="history(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
                       color:orange;"
             >
-              进度
+              查看进度
             </a-button>
 
             <a-button
@@ -129,7 +129,7 @@
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
                       color:#4e73b9;"
             >
-              详情
+              表单数据
             </a-button>
           </span>
 
@@ -138,7 +138,7 @@
             <a-button
               class="itemBtn"
               ghost
-              @click="detail(item)"
+              @click="apply(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
                       color:rgb(80, 95, 102);"
             >
@@ -157,17 +157,17 @@
             <a-button
               class="itemBtn"
               ghost
-              @click="detail(item)"
+              @click="history(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
                       color:gray;"
             >
-              历史
+              审批历史
             </a-button>
 
             <a-button
               class="itemBtn"
               ghost
-              @click="detail(item)"
+              @click="remove(item)"
               style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
                       color:red;"
             >
@@ -177,6 +177,7 @@
         </div>
       </div>
     </a-card>
+
     <!--流程申请选择-->
     <a-drawer
       title="选择流程"
@@ -272,7 +273,6 @@
           <div style="display:inline-block;width: 20px;"></div>
           <a-button type="primary" :disabled="submitLoading" @click="applySubmit">提交</a-button>
         </div>
-        
       </div>
     </a-modal>
 
@@ -378,6 +378,26 @@ export default {
   },
   computed: {},
   methods: {
+    init() {
+      this.getDataList()
+    },
+    getDataList() {
+      this.loading = true
+      getAction(this.url.todoList, {}).then(res => {
+        if (res.success) {
+          this.todoList = res.result || []
+          // this.total = this.data.leading
+          console.log('2次 waitTab 待办列表', this.todoList)
+        }
+      }),
+        getAction(this.url.doneList).then(res => {
+          if (res.success) {
+            this.doneList = res.result || []
+            console.log('最新已办列表1', this.doneList)
+            console.log('最新已办列表2', res.result)
+          }
+        })
+    },
     //初始化字典 - 流程分类
     initDictConfig() {
       initDictOptions('bpm_process_type').then(res => {
@@ -398,6 +418,7 @@ export default {
       }
       return text || text == 'null' ? '' : text
     },
+
     //进度列表
     getProcessList() {
       this.addApplyLoading = true
@@ -430,7 +451,7 @@ export default {
 
     //
     loadData(arg) {
-      console.log('loadData')
+      // console.log('loadData')
       if (!this.url.list) {
         this.$message.error('请设置url.list属性!')
         return
@@ -479,6 +500,7 @@ export default {
       this.queryParam.createTime_end = dateString[1]
     },
 
+    //
     onDateOk(value) {
       console.log(value)
     },
@@ -565,13 +587,14 @@ export default {
             return
           }
           this.modalVisible = true
+          this.getDataList()
         } else {
           this.$message.error(res.message)
         }
       })
     },
 
-    //申请提交
+    //重新申请 提交
     applySubmit() {
       if (this.showAssign && this.form.assignees.length < 1) {
         this.error = '请至少选择一个审批人'
@@ -589,9 +612,13 @@ export default {
             this.$message.success('操作成功')
             this.loadData()
             this.modalVisible = false
+            console.log('重新申请的提交 走这没')
+            this.getDataList()
           } else {
             this.$message.error(res.message)
           }
+          console.log('这是哪 走这没')
+          this.getDataList()
         })
         .finally(() => (this.submitLoading = false))
     },
@@ -628,7 +655,7 @@ export default {
 
     // 删除
     remove(r) {
-      console.log('点击了删除');
+      console.log('点击了删除')
       this.postFormAction(this.url.delByIds, { ids: r.id }).then(res => {
         if (res.success) {
           this.$message.success(res.message)
@@ -678,7 +705,7 @@ export default {
       this.edit(v, true)
     },
 
-    //
+    // 分页
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       //TODO 筛选
@@ -690,7 +717,7 @@ export default {
       // this.loadData();
     },
 
-    //
+    // 发起申请   可删
     addApply() {
       this.getProcessList()
     },

+ 2 - 4
src/views/user/tabs/DoneTab.vue

@@ -87,8 +87,6 @@
       </div>
     </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>
@@ -109,6 +107,7 @@
 </template>
 
 <script>
+import { deleteAction, getAction, downFile } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 export default {
@@ -216,7 +215,6 @@ export default {
 
     // 详情
     detail(r) {
-      console.log('啥也没有,啥情况')
       if (!r.routeName) {
         this.$message.warning('该流程信息未配置表单,请联系开发人员!')
         return
@@ -280,7 +278,7 @@ export default {
         this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
       this.ipagination = pagination
-      // this.loadData();
+      this.loadData();
     }
   }
 }

+ 25 - 33
src/views/user/tabs/WaitTab.vue

@@ -14,35 +14,14 @@
       <!-- 优先级 -->
       <p>
         优先级:
-        <span
-          class="priorityComm"
-          v-if="item.priority == 0"
-          style="background:rgba(252, 96, 10,.4);
-                    padding:2px 6px;
-                    borderRadius:2px;
-                    color:#092834;"
-        >
+        <span class="priorityComm" v-if="item.priority == 0" style="background:rgba(252, 96, 10,.4);color:#092834;">
           普通
         </span>
-        <span
-          class="priorityComm"
-          v-else-if="item.priority == 1"
-          style="background:#FC600A;
-                    padding:4px 10px;
-                    borderRadius:6px;
-                    color:white;"
-        >
+        <span class="priorityComm" v-else-if="item.priority == 1" style="background:#FC600A;color:white;">
           重要
         </span>
 
-        <span
-          class="priorityComm"
-          v-else-if="item.priority == 2"
-          style="background:red;
-                    padding:4px 10px;
-                    borderRadius:6px;
-                    color:white;"
-        >
+        <span class="priorityComm" v-else-if="item.priority == 2" style="background:red;color:white;">
           紧急
         </span>
         <span class="priorityComm" v-else style="background:#999;">
@@ -53,10 +32,10 @@
       <!-- 状态 -->
       <p style="float:left;marginBottom:30px;">
         状态:
-        <span v-if="item.isSuspended == false" style="background:rgba(252, 96, 10,.8);" class="resultComm">
+        <span v-if="item.isSuspended == false" style="background:rgba(252, 96, 10,.8)" class="resultComm">
           已激活
         </span>
-        <span v-if="item.isSuspended == true" style="background:rgba(20, 137, 184,.8);" class="resultComm">
+        <span v-if="item.isSuspended == true" style="background:rgba(20, 137, 184,.8)" class="resultComm">
           已挂起
         </span>
         {{ item.status }}
@@ -148,6 +127,10 @@
 
     <!--审批历史-->
     <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
+      <a-card class="cardTask">
+
+        
+      </a-card>
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
@@ -166,7 +149,7 @@
       ></component>
     </a-modal>
 
-    <!-- 审批操作 -->
+    <!-- 通过、驳回、委托 弹框 -->
     <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500">
       <div v-if="modalTaskVisible">
         <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
@@ -302,7 +285,7 @@ export default {
     this.init()
   },
   methods: {
-    //
+    //初始化表单
     forminitial() {
       this.form = {
         id: '',
@@ -336,25 +319,33 @@ export default {
     //   })
     // },
 
+    //发请求拿到 todoList
     getDataList() {
       this.loading = true
-      // 待办
       getAction(this.url.todoList, {}).then(res => {
         if (res.success) {
           this.todoList = res.result || []
           // this.total = this.data.leading
-          console.log('wait页面渲染待办列表', this.todoList)
+          console.log('2次 waitTab 待办列表', this.todoList)
         }
-      })
+      }),
+        getAction(this.url.doneList).then(res => {
+          if (res.success) {
+            this.doneList = res.result || []
+            console.log('最新已办列表1', this.doneList)
+            console.log('最新已办列表2', res.result)
+          }
+        })
     },
+
+    //分页、排序、筛选变化时触发
     handleTableChange(pagination, filters, sorter) {
-      //分页、排序、筛选变化时触发
       if (Object.keys(sorter).length > 0) {
         this.isorter.column = sorter.field
         this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
       this.ipagination = pagination
-      // this.loadData();
+      this.loadData()
     },
 
     //
@@ -588,6 +579,7 @@ export default {
 
     // 历史
     history(v) {
+      console.log(v)
       if (!v.procInstId) {
         this.$message.error('流程实例ID不存在')
         return