|
|
|
@ -17,17 +17,17 @@ |
|
|
|
@keyup.native="btKeyUpDictType" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.pid !== '0'"> |
|
|
|
<el-form-item v-if="dataForm.pid !== '0'" label='字典值'> |
|
|
|
<el-input v-model="dataForm.dictValue" |
|
|
|
:placeholder="$t('dict.dictValue')" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataListSearch()" type='primary'>{{ $t('query') }}</el-button> |
|
|
|
<el-button @click="getDataListSearch()" type='success'>{{ $t('query') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button v-if="$hasPermission('sys:dict:save')" |
|
|
|
type="success" |
|
|
|
type="primary" |
|
|
|
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item> |
|
|
|
@ -143,16 +143,18 @@ export default { |
|
|
|
components: { |
|
|
|
AddOrUpdate |
|
|
|
}, |
|
|
|
activated () { |
|
|
|
created: function () { |
|
|
|
// 通过路由参数pid, 控制列表请求操作 |
|
|
|
this.dataForm.pid = this.$route.params.pid || '0' |
|
|
|
if (this.dataForm.pid !== '0') { |
|
|
|
this.mixinViewModuleOptions.getDataListURL = '/sys/dict/list' |
|
|
|
this.mixinViewModuleOptions.getDataListIsPage = false |
|
|
|
this.dataForm.dictType = this.$route.params.type || '' |
|
|
|
} |
|
|
|
this.getDataList() |
|
|
|
}, |
|
|
|
activated(){ |
|
|
|
this.getDataList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 子级 |
|
|
|
childHandle (row) { |
|
|
|
@ -195,9 +197,18 @@ export default { |
|
|
|
addOrUpdateHandle (row = {}) { |
|
|
|
this.addOrUpdateVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
var dictTypeSubStr = '' |
|
|
|
if (this.dataForm.pid !== '0') { |
|
|
|
var titleName = `${this.$route.meta.title}` |
|
|
|
var startIndex = titleName.indexOf('- ') === -1 ? 0 : titleName.indexOf('- ') |
|
|
|
dictTypeSubStr = titleName.substr(startIndex,titleName.length).replace('- ','') |
|
|
|
} |
|
|
|
this.$refs.addOrUpdate.dataForm.id = row.id |
|
|
|
this.$refs.addOrUpdate.dataForm.pid = this.dataForm.pid |
|
|
|
this.$refs.addOrUpdate.dataForm.dictType = row.dictType || this.dataForm.dictType || '' |
|
|
|
if (this.$refs.addOrUpdate.dataForm.dictType === null || this.$refs.addOrUpdate.dataForm.dictType === '') { |
|
|
|
this.$refs.addOrUpdate.dataForm.dictType = dictTypeSubStr |
|
|
|
} |
|
|
|
this.$refs.addOrUpdate.init() |
|
|
|
}) |
|
|
|
} |
|
|
|
|