|
@ -5,19 +5,19 @@ |
|
|
<span class="dialog-left-bottom" /> |
|
|
<span class="dialog-left-bottom" /> |
|
|
<div class="setting-dialog"> |
|
|
<div class="setting-dialog"> |
|
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
<el-form-item label="门类名称" prop="dicName"> |
|
|
|
|
|
<el-input v-model="form.dicName" style="width: 370px;" /> |
|
|
|
|
|
|
|
|
<el-form-item label="门类名称" prop="cnName"> |
|
|
|
|
|
<el-input v-model="form.cnName" style="width: 370px;" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="门类类型" prop="dicCode"> |
|
|
|
|
|
<el-select v-model="form.dicCode" style="width: 370px;" @change="changeType"> |
|
|
|
|
|
|
|
|
<el-form-item label="门类类型" prop="isType"> |
|
|
|
|
|
<el-select v-model="form.isType" style="width: 370px;" @change="changeType"> |
|
|
<el-option v-for="item in selectOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
<el-option v-for="item in selectOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="选择模板" prop="dicExplain"> |
|
|
<el-form-item label="选择模板" prop="dicExplain"> |
|
|
<treeselect v-model="form.dicExplain" :options="templateTree" placeholder="" style="width: 370px;" :disabled="form.dicCode !== '6'" :normalizer="normalizer" /> |
|
|
|
|
|
|
|
|
<treeselect v-model="form.dicExplain" :options="templateTree" placeholder="" style="width: 370px;" :disabled="form.isType !== '6'" :normalizer="normalizer" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="内容说明"> |
|
|
<el-form-item label="内容说明"> |
|
|
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" /> |
|
|
|
|
|
|
|
|
<el-input v-model="form.remark" style="width: 370px;" type="textarea" :rows="4" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
@ -29,91 +29,61 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import crudDict from '@/api/archivesConfig/dict' |
|
|
|
|
|
|
|
|
import { getCategoryTree, getCategoryType } from '@/api/category/category' |
|
|
import { form } from '@crud/crud' |
|
|
import { form } from '@crud/crud' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
|
|
|
|
|
|
const defaultForm = { id: null, dicName: null, dicCode: '1', dicExplain: null, dicType: true } |
|
|
|
|
|
|
|
|
const defaultForm = { id: null, cnName: null, isType: '1', remark: null } |
|
|
export default { |
|
|
export default { |
|
|
components: { Treeselect }, |
|
|
components: { Treeselect }, |
|
|
mixins: [form(defaultForm)], |
|
|
|
|
|
|
|
|
mixins: [ |
|
|
|
|
|
form(function() { |
|
|
|
|
|
return Object.assign({ pid: this.pid }, defaultForm) |
|
|
|
|
|
}) |
|
|
|
|
|
], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
pid: null, |
|
|
rules: { |
|
|
rules: { |
|
|
dicName: [ |
|
|
|
|
|
{ required: true, message: '请输入字典名称', trigger: 'blur' } |
|
|
|
|
|
|
|
|
cnName: [ |
|
|
|
|
|
{ required: true, message: '请输入门类名称', trigger: 'blur' } |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
selectOptions: [ |
|
|
|
|
|
{ |
|
|
|
|
|
value: '1', |
|
|
|
|
|
label: '文件夹' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: '2', |
|
|
|
|
|
label: '项目' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: '3', |
|
|
|
|
|
label: '案卷' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: '4', |
|
|
|
|
|
label: '卷内' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: '5', |
|
|
|
|
|
label: '文件' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: '6', |
|
|
|
|
|
label: '选择模板' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
templateTree: [ |
|
|
|
|
|
{ |
|
|
|
|
|
id: 'a', |
|
|
|
|
|
label: 'a', |
|
|
|
|
|
children: [ |
|
|
|
|
|
{ |
|
|
|
|
|
id: 'aa', |
|
|
|
|
|
label: 'aa' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 'ab', |
|
|
|
|
|
label: 'ab' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 'b', |
|
|
|
|
|
label: 'b' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 'c', |
|
|
|
|
|
label: 'c' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
selectOptions: [], |
|
|
|
|
|
templateTree: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
this.getSelectOptions() |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
changeType() { |
|
|
changeType() { |
|
|
if (this.form.dicCode === '6') { |
|
|
|
|
|
|
|
|
if (this.form.isType === '6') { |
|
|
// this.crudDict.getDicts() |
|
|
// this.crudDict.getDicts() |
|
|
this.getTemplateTree() |
|
|
this.getTemplateTree() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getTemplateTree() { |
|
|
getTemplateTree() { |
|
|
crudDict.getDicts().then(res => { |
|
|
|
|
|
|
|
|
getCategoryTree().then(res => { |
|
|
this.templateTree = res |
|
|
this.templateTree = res |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
getSelectOptions() { |
|
|
|
|
|
getCategoryType().then(res => { |
|
|
|
|
|
for (const key in res) { |
|
|
|
|
|
this.selectOptions.push({ |
|
|
|
|
|
value: key, |
|
|
|
|
|
label: res[key] |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
normalizer(node) { |
|
|
normalizer(node) { |
|
|
return { |
|
|
return { |
|
|
id: node.id, |
|
|
id: node.id, |
|
|
label: node.dicName, |
|
|
|
|
|
children: node.childMenus |
|
|
|
|
|
|
|
|
label: node.cnName, |
|
|
|
|
|
children: node.children |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|