Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into HEAD

This commit is contained in:
aoli.qu 2021-09-01 11:12:18 +08:00
commit 63416eb973
3 changed files with 23 additions and 16 deletions

View File

@ -114,8 +114,8 @@ export default {
methods: {
//
selectTree(selectedKeys, e) {
this.selectKey = e.node.eventKey;
this.selectTitle = e.node.title;
this.selectKey = e.node.dataRef.key;
this.selectTitle = e.node.dataRef.title;
this.$emit('getSelectTreeKey', this.selectKey);
},
// /

View File

@ -2,9 +2,9 @@
<a-form layout="inline" :model="form" ref="queryForm">
<a-row :gutter="48">
<a-col :md="6" :sm="24" v-for="(item, index) in list" :key="index">
<a-form-item :label="item.placeholder">
<a-form-item :label="item.placeholder" :style="{marginBottom: '8px'}">
<!-- input -->
<a-input v-if="item.type === 'input'" v-model="form[item.key]" :type="item.type || 'text'" :placeholder="item.placeholder || '请输入'"/>
<a-input v-if="item.type === 'input'" v-model="form[item.key]" :type="item.type || 'text'" :placeholder="item.placeholder || '请输入'" />
<!-- select-common -->
<a-select v-if="item.type === 'select'" v-model="form[item.key]" placeholder="请选择">
@ -17,13 +17,7 @@
</a-select>
<!-- date -->
<a-date-picker
v-if="item.type === 'date'"
v-model="form[item.key]"
style="width: 100%"
:format="item.format"
:valueFormat="item.format"
:placeholder="item.placeholder || '请输入日期'"/>
<a-date-picker v-if="item.type === 'date'" v-model="form[item.key]" style="width: 100%" :format="item.format" :valueFormat="item.format" :placeholder="item.placeholder || '请输入日期'" />
</a-form-item>
</a-col>
@ -31,12 +25,20 @@
<a-button type="primary" @click="handleQuery">查询</a-button>
<a-button @click="resetQuery">重置</a-button>
</a-col>
<!-- orgTree -->
<a-col :span="24" :style="{marginTop: '-8px', marginBottom: '8px'}">
<org-tree v-show="orgTree.ifshow" :startOrganizationId="orgTree.startOrganizationId" @getSelectTreeKey="key => form[orgTree.formKey] = key"></org-tree>
</a-col>
</a-row>
</a-form>
</template>
<script>
import orgTree from '../OrgTree/Index'
export default {
components: { orgTree },
props: {
form: {
type: Object,
@ -47,16 +49,21 @@ export default {
type: Array,
required: true,
default: () => []
},
orgTree: {
type: Object,
required: false,
default: () => { return { ifshow: false, formKey: '', startOrganizationId: '' } }
}
},
data () {
data() {
return {}
},
methods: {
handleQuery () {
handleQuery() {
this.$emit('search')
},
resetQuery () {
resetQuery() {
this.$emit('reset')
}
}

View File

@ -48,8 +48,8 @@ const errorHandler = (error) => {
// request interceptor
request.interceptors.request.use(config => {
// const token = storage.get(ACCESS_TOKEN)
// 由于登录接口待联调token使用默认值
const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIwMzU2Nzg5LWYyOGEtNDYxYi1iNTRhLTM2MWYzZjdhZjg2NSJ9.4vGoaj9KK8aYp9gEz2cnRM8MBWPrqIo8O5wNgbYK4-JUE3naeEuejjr3JfZ57TLbMYWqG1MkJ0kAT-2GMgreGQ'
// 由于登录接口待联调token使用默认值
const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjBkYjU0YzQ0LWQ5MDktNDQ0ZC05YTYwLTE4ZGU1YjgyMzg5YyJ9.l37UO6WC9tPTuoJnbWKpTusHdtmon95Islq-jRNo9zmCKJ4GWwnY9_szBpgOii2Y7OVvc4sWibmFBdTwmAg8sg'
// 如果 token 存在,让每个请求携带自定义 token 请根据实际情况自行修改
if (token) {
config.headers[ACCESS_TOKEN] = token