mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-23 17:55:39 +08:00
-- 项目创建修改
This commit is contained in:
62
src/components/project/OrgClass.vue
Normal file
62
src/components/project/OrgClass.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<a-tree-select
|
||||
v-model:value="id"
|
||||
style="width: 100%"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
placeholder="自动带出 可修改"
|
||||
allow-clear
|
||||
:tree-data="options"
|
||||
:fieldNames="{
|
||||
children: 'treeChildList',
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
}"
|
||||
:disabled="viewDetail ? true : false"
|
||||
@change="change"
|
||||
dropdownClassName="treeDropdown"
|
||||
>
|
||||
</a-tree-select>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OrgClass",
|
||||
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.value
|
||||
});
|
||||
watch(state.id, () => {
|
||||
ctx.emit('update:modelValue', state.id)
|
||||
})
|
||||
onMounted(() => {
|
||||
state.options = [{id: props.modelValue, name: props.name}, ...store.state.orgtreeList]
|
||||
})
|
||||
function change(key, obj) {
|
||||
ctx.emit('update:name', obj[0])
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
change
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
48
src/components/project/ProjectClass.vue
Normal file
48
src/components/project/ProjectClass.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<!-- 评估管理-创建评估页面 -->
|
||||
<template>
|
||||
<a-select
|
||||
v-model:value="id"
|
||||
placeholder="请选择分类"
|
||||
style="width: 100%"
|
||||
:options="options"
|
||||
allowClear
|
||||
:disabled="disabled"
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ProjectClass",
|
||||
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.modelValue
|
||||
});
|
||||
watch(state.id,()=>{
|
||||
ctx.emit('update:modelValue',state.id)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
state.options = store.state.projectClass.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
45
src/components/project/ProjectLevel.vue
Normal file
45
src/components/project/ProjectLevel.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<a-select
|
||||
v-model:value="id"
|
||||
:options="options"
|
||||
style="width: 100%"
|
||||
placeholder="请选择项目级别"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ProjectClass",
|
||||
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.modelValue
|
||||
});
|
||||
watch(state.id, () => {
|
||||
ctx.emit('update:modelValue', state.id)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
state.options = store.state.projectLevel.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
104
src/components/project/ProjectManager.vue
Normal file
104
src/components/project/ProjectManager.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<a-select
|
||||
v-model:value="managerArray"
|
||||
placeholder="请选择项目经理"
|
||||
:filterOption="false"
|
||||
style="width: 100%"
|
||||
:options="options"
|
||||
allowClear
|
||||
showSearch
|
||||
mode="multiple"
|
||||
:disabled="disabled"
|
||||
@popupScroll="memberScroll"
|
||||
@search="searchMember"
|
||||
@change="change"
|
||||
>
|
||||
<template v-if="loading" #notFoundContent>
|
||||
<a-spin size="small"/>
|
||||
</template>
|
||||
</a-select>
|
||||
</template>
|
||||
<script>
|
||||
import {reactive, toRefs, watch} from "vue";
|
||||
import {scrollLoad} from "@/api/method";
|
||||
import * as api1 from "@/api/index1";
|
||||
|
||||
export default {
|
||||
name: "ProjectClass",
|
||||
|
||||
props: {
|
||||
value: {
|
||||
type: Number,
|
||||
},
|
||||
name: {
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
options: [],
|
||||
managerArray: [],
|
||||
memberParam: {keyWord: '', pageNo: 1, pageSize: 10},
|
||||
loading: false,
|
||||
init: false
|
||||
});
|
||||
|
||||
watch(() => state.memberParam, getMember)
|
||||
watch(() => props.value, init)
|
||||
|
||||
function getMember() {
|
||||
state.loading = true
|
||||
api1.getMemberInfo(state.memberParam).then((res) => {
|
||||
const list = res.data.data.rows.filter(e => !props.value?.includes(e.id + '')).map(e => ({
|
||||
label: e.realName,
|
||||
value: e.id
|
||||
}));
|
||||
state.options.push(...list)
|
||||
state.loading = false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const memberScroll = (e) => {
|
||||
let num = scrollLoad(e);
|
||||
if (num === 2) {
|
||||
// 如果滑到底部,则加载下一页
|
||||
state.memberParam.pageNo++;
|
||||
}
|
||||
};
|
||||
|
||||
//搜索学员
|
||||
const searchMember = (keyWord) => {
|
||||
keyWord && (state.memberParam = {keyWord, pageNo: 1, pageSize: 10});
|
||||
};
|
||||
|
||||
function init() {
|
||||
if (props.value && props.name) {
|
||||
const arrManager = props.name.split(',')
|
||||
const arrManagerId = props.value.split(',')
|
||||
state.managerArray = arrManagerId
|
||||
state.options = arrManager.map((e, i) => ({label: e, value: arrManagerId[i]}))
|
||||
state.init = true
|
||||
getMember()
|
||||
}
|
||||
}
|
||||
|
||||
function change(e, l) {
|
||||
console.log('change')
|
||||
ctx.emit('update:value', e.join(','))
|
||||
ctx.emit('update:name', l.map(t => t.label).join(','))
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
searchMember,
|
||||
memberScroll,
|
||||
change
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
44
src/components/project/TrainClass.vue
Normal file
44
src/components/project/TrainClass.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<a-select
|
||||
v-model:value="id"
|
||||
:options="options"
|
||||
style="width: 100%"
|
||||
placeholder="请选择分类"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "TrainClass",
|
||||
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.modelValue
|
||||
});
|
||||
watch(state.id, () => {
|
||||
ctx.emit('update:modelValue', state.id)
|
||||
})
|
||||
onMounted(() => {
|
||||
state.options = store.state.projectSys.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user