Merge remote-tracking branch 'origin/zhoulingpo' into zhoulingpo
This commit is contained in:
@@ -59,4 +59,11 @@ export default {
|
|||||||
params:data
|
params:data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取字典值
|
||||||
|
getCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/sys/dictItem/'+data,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export default {
|
|||||||
this.$store.commit('saveUserInfo', null)
|
this.$store.commit('saveUserInfo', null)
|
||||||
this.$store.commit('setHandleProcess', null)
|
this.$store.commit('setHandleProcess', null)
|
||||||
this.$store.commit('savePathUrl', null)
|
this.$store.commit('savePathUrl', null)
|
||||||
|
this.$store.commit('removeDicts', null)
|
||||||
// var sevice = "http://"+window.location.host+"/";
|
// var sevice = "http://"+window.location.host+"/";
|
||||||
// var serviceUrl = encodeURIComponent(sevice);
|
// var serviceUrl = encodeURIComponent(sevice);
|
||||||
// 正式
|
// 正式
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
// 混入字典方法 做到按需加载
|
||||||
|
import interfaces from "@/api/modules/dictionary";
|
||||||
|
import store from "@/store";
|
||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
|
class Dict {
|
||||||
|
constructor(dict) {
|
||||||
|
this.dict = dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
async init(names) {
|
||||||
|
const ps = [];
|
||||||
|
names.forEach((name) => {
|
||||||
|
if (store.getters.dicts[name]) {
|
||||||
|
Vue.set(this.dict, name, store.getters.dicts[name]);
|
||||||
|
} else {
|
||||||
|
Vue.set(this.dict, name, []);
|
||||||
|
ps.push(
|
||||||
|
interfaces.getCode(name).then((res) => {
|
||||||
|
this.dict[name] = Object.freeze(res.data);
|
||||||
|
store.dispatch('setDicts_a', {
|
||||||
|
label: name,
|
||||||
|
value: Object.freeze(res.data),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await Promise.all(ps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const install = function (Vue) {
|
||||||
|
Vue.mixin({
|
||||||
|
data() {
|
||||||
|
if (
|
||||||
|
this.$options.dicts instanceof Array &&
|
||||||
|
this.$options.dicts.length > 0
|
||||||
|
) {
|
||||||
|
return { dict: {} };
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (
|
||||||
|
this.$options.dicts instanceof Array &&
|
||||||
|
this.$options.dicts.length > 0
|
||||||
|
) {
|
||||||
|
new Dict(this.dict).init(this.$options.dicts);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default { install };
|
||||||
|
|
||||||
+2
-1
@@ -35,13 +35,14 @@ import VueQuillEditor from 'vue-quill-editor'
|
|||||||
import 'quill/dist/quill.core.css'
|
import 'quill/dist/quill.core.css'
|
||||||
import 'quill/dist/quill.snow.css'
|
import 'quill/dist/quill.snow.css'
|
||||||
import 'quill/dist/quill.bubble.css'
|
import 'quill/dist/quill.bubble.css'
|
||||||
|
import dict from '@/components/dict'
|
||||||
|
|
||||||
VXETable.setup({
|
VXETable.setup({
|
||||||
table: {
|
table: {
|
||||||
resizable: true
|
resizable: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Vue.use(dict);
|
||||||
Vue.use(VXETable)
|
Vue.use(VXETable)
|
||||||
Vue.use(VueQuillEditor)
|
Vue.use(VueQuillEditor)
|
||||||
Vue.use(ElementUI, { size: 'mini', zIndex: 3000 })
|
Vue.use(ElementUI, { size: 'mini', zIndex: 3000 })
|
||||||
|
|||||||
+15
-3
@@ -14,7 +14,8 @@ export default new Vuex.Store({
|
|||||||
menuName: '',
|
menuName: '',
|
||||||
activeTab: '',
|
activeTab: '',
|
||||||
handleProcess: '',
|
handleProcess: '',
|
||||||
marketpre:''
|
marketpre:'',
|
||||||
|
dicts:{}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
marketpre: (state) => state.marketpre,
|
marketpre: (state) => state.marketpre,
|
||||||
@@ -22,9 +23,16 @@ export default new Vuex.Store({
|
|||||||
menuName: (state) => state.menuName,
|
menuName: (state) => state.menuName,
|
||||||
userInfo: (state) => state.userInfo,
|
userInfo: (state) => state.userInfo,
|
||||||
activeTab: (state) =>state.activeTab,
|
activeTab: (state) =>state.activeTab,
|
||||||
handleProcess: (state) =>state.handleProcess
|
handleProcess: (state) =>state.handleProcess,
|
||||||
|
dicts: (state) =>state.dicts
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
setDicts(state, obj) {
|
||||||
|
state.dicts[obj.label] = obj.value;
|
||||||
|
},
|
||||||
|
removeDicts(state, obj) {
|
||||||
|
state.dicts = {}
|
||||||
|
},
|
||||||
setMarketpre(state, data){
|
setMarketpre(state, data){
|
||||||
state.marketpre = data
|
state.marketpre = data
|
||||||
},
|
},
|
||||||
@@ -53,7 +61,11 @@ export default new Vuex.Store({
|
|||||||
state.menuName = data
|
state.menuName = data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {},
|
actions: {
|
||||||
|
setDicts_a({ commit }, obj) {
|
||||||
|
commit('setDicts', obj)
|
||||||
|
},
|
||||||
|
},
|
||||||
modules: {},
|
modules: {},
|
||||||
plugins: [createPersistedState()]
|
plugins: [createPersistedState()]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ instance.interceptors.response.use(function (response) {
|
|||||||
if (error.response.data.status == 401) {
|
if (error.response.data.status == 401) {
|
||||||
store.commit('savePathUrl', null)
|
store.commit('savePathUrl', null)
|
||||||
store.commit('setHandleProcess', null)
|
store.commit('setHandleProcess', null)
|
||||||
|
store.commit('removeDicts', null)
|
||||||
router.push('/login')
|
router.push('/login')
|
||||||
Message.error('登录超时过期')
|
Message.error('登录超时过期')
|
||||||
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
|
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
|
||||||
@@ -95,6 +96,7 @@ instance.interceptors.response.use(function (response) {
|
|||||||
if (error.response.status === 500) {
|
if (error.response.status === 500) {
|
||||||
store.commit('savePathUrl', null)
|
store.commit('savePathUrl', null)
|
||||||
store.commit('setHandleProcess', null)
|
store.commit('setHandleProcess', null)
|
||||||
|
store.commit('removeDicts', null)
|
||||||
router.push('/login')
|
router.push('/login')
|
||||||
Message.error('登录超时过期')
|
Message.error('登录超时过期')
|
||||||
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
|
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
|
||||||
|
|||||||
@@ -73,16 +73,16 @@
|
|||||||
<div class="user-form">
|
<div class="user-form">
|
||||||
<el-form ref="addForm" :model="form" label-width="186px" :disabled="mode === 'view'"
|
<el-form ref="addForm" :model="form" label-width="186px" :disabled="mode === 'view'"
|
||||||
:rules="formRule">
|
:rules="formRule">
|
||||||
<el-form-item label="选项:" >
|
<el-form-item label="选项:" required>
|
||||||
<el-input v-model="form.itemName" maxlength="20" show-word-limit placeholder="请输入选项"></el-input>
|
<el-input v-model="form.itemName" maxlength="20" show-word-limit placeholder="请输入选项"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="选项值:" >
|
<el-form-item label="选项值:" required>
|
||||||
<el-input v-model="form.itemValue" maxlength="20" placeholder="请输入值" show-word-limit></el-input>
|
<el-input v-model="form.itemValue" maxlength="20" placeholder="请输入值" show-word-limit></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--<el-form-item label="确认密码:" :required="mode === 'add'" v-if="mode !== 'view'">-->
|
<!--<el-form-item label="确认密码:" :required="mode === 'add'" v-if="mode !== 'view'">-->
|
||||||
<!--<el-input v-model="repassword" maxlength="20" type="password" placeholder="请确认密码"></el-input>-->
|
<!--<el-input v-model="repassword" maxlength="20" type="password" placeholder="请确认密码"></el-input>-->
|
||||||
<!--</el-form-item>-->
|
<!--</el-form-item>-->
|
||||||
<el-form-item label="排序:" >
|
<el-form-item label="排序:" required>
|
||||||
<el-input v-model="form.itemOrder"show-word-limit maxlength="10" placeholder="请输入排序"></el-input>
|
<el-input v-model="form.itemOrder"show-word-limit maxlength="10" placeholder="请输入排序"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注:" >
|
<el-form-item label="备注:" >
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
<el-col :span="9" :offset="6">
|
<el-col :span="9" :offset="6">
|
||||||
<el-form-item label="报告涉密等级:" prop="confidentialLevel">
|
<el-form-item label="报告涉密等级:" prop="confidentialLevel">
|
||||||
<el-select :disabled="formControl" v-model="form.confidentialLevel" placeholder="请选择报告涉密等级">
|
<el-select :disabled="formControl" v-model="form.confidentialLevel" placeholder="请选择报告涉密等级">
|
||||||
<el-option v-for="item in confidentialLevelOptions" :key="item.value" :label="item.label"
|
<el-option v-for="item in dict['classified_level']" :key="item.itemValue" :label="item.itemName"
|
||||||
:value="item.value">
|
:value="item.itemValue">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<el-col :span="9" :offset="6">
|
<el-col :span="9" :offset="6">
|
||||||
<el-form-item label="报告隐私等级:" prop="privacyLevelOptions">
|
<el-form-item label="报告隐私等级:" prop="privacyLevelOptions">
|
||||||
<el-select :disabled="formControl" v-model="form.privacyLevelOptions" placeholder="请选择报告隐私等级">
|
<el-select :disabled="formControl" v-model="form.privacyLevelOptions" placeholder="请选择报告隐私等级">
|
||||||
<el-option v-for="item in privacyLevelOptions" :key="item.value" :label="item.label" :value="item.value">
|
<el-option v-for="item in dict['privacy_level']" :key="item.itemValue" :label="item.itemName" :value="item.itemValue">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -148,6 +148,7 @@ import newTranslate from "../../../components/newTranslate";
|
|||||||
import VueTagsInput from '@johmun/vue-tags-input';
|
import VueTagsInput from '@johmun/vue-tags-input';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
dicts:['classified_level','privacy_level'],
|
||||||
components: {
|
components: {
|
||||||
VueTagsInput,
|
VueTagsInput,
|
||||||
newTranslate
|
newTranslate
|
||||||
|
|||||||
@@ -244,7 +244,6 @@ export default {
|
|||||||
twoApprove: ''
|
twoApprove: ''
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.applicationFormRef.clearValidate()
|
|
||||||
this.$refs.assignFormRef.clearValidate()
|
this.$refs.assignFormRef.clearValidate()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user