表格搜索组件新增组织机构树
This commit is contained in:
parent
107eca865d
commit
2ade51f1c2
|
@ -2,9 +2,9 @@
|
||||||
<a-form layout="inline" :model="form" ref="queryForm">
|
<a-form layout="inline" :model="form" ref="queryForm">
|
||||||
<a-row :gutter="48">
|
<a-row :gutter="48">
|
||||||
<a-col :md="6" :sm="24" v-for="(item, index) in list" :key="index">
|
<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 -->
|
<!-- 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 -->
|
<!-- select-common -->
|
||||||
<a-select v-if="item.type === 'select'" v-model="form[item.key]" placeholder="请选择">
|
<a-select v-if="item.type === 'select'" v-model="form[item.key]" placeholder="请选择">
|
||||||
|
@ -17,13 +17,7 @@
|
||||||
</a-select>
|
</a-select>
|
||||||
|
|
||||||
<!-- date -->
|
<!-- date -->
|
||||||
<a-date-picker
|
<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 || '请输入日期'" />
|
||||||
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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -31,12 +25,20 @@
|
||||||
<a-button type="primary" @click="handleQuery">查询</a-button>
|
<a-button type="primary" @click="handleQuery">查询</a-button>
|
||||||
<a-button @click="resetQuery">重置</a-button>
|
<a-button @click="resetQuery">重置</a-button>
|
||||||
</a-col>
|
</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-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import orgTree from '../OrgTree/Index'
|
||||||
export default {
|
export default {
|
||||||
|
components: { orgTree },
|
||||||
props: {
|
props: {
|
||||||
form: {
|
form: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -47,16 +49,21 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
orgTree: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => { return { ifshow: false, formKey: '', startOrganizationId: '' } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleQuery () {
|
handleQuery() {
|
||||||
this.$emit('search')
|
this.$emit('search')
|
||||||
},
|
},
|
||||||
resetQuery () {
|
resetQuery() {
|
||||||
this.$emit('reset')
|
this.$emit('reset')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ const errorHandler = (error) => {
|
||||||
// request interceptor
|
// request interceptor
|
||||||
request.interceptors.request.use(config => {
|
request.interceptors.request.use(config => {
|
||||||
// const token = storage.get(ACCESS_TOKEN)
|
// const token = storage.get(ACCESS_TOKEN)
|
||||||
// 由于登录接口待联调,token使用默认值
|
// 由于登录接口待联调,token使用默认值
|
||||||
const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIwMzU2Nzg5LWYyOGEtNDYxYi1iNTRhLTM2MWYzZjdhZjg2NSJ9.4vGoaj9KK8aYp9gEz2cnRM8MBWPrqIo8O5wNgbYK4-JUE3naeEuejjr3JfZ57TLbMYWqG1MkJ0kAT-2GMgreGQ'
|
const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjBkYjU0YzQ0LWQ5MDktNDQ0ZC05YTYwLTE4ZGU1YjgyMzg5YyJ9.l37UO6WC9tPTuoJnbWKpTusHdtmon95Islq-jRNo9zmCKJ4GWwnY9_szBpgOii2Y7OVvc4sWibmFBdTwmAg8sg'
|
||||||
// 如果 token 存在,让每个请求携带自定义 token 请根据实际情况自行修改
|
// 如果 token 存在,让每个请求携带自定义 token 请根据实际情况自行修改
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers[ACCESS_TOKEN] = token
|
config.headers[ACCESS_TOKEN] = token
|
||||||
|
|
Loading…
Reference in New Issue