近期klqa模块针对旧版的项目管理系统进行优化,使用vue+iview 方式重新编写了新的项目管理系统,改善了视觉体验,当然问题还是很多,此外,flask、vue、iview这三者结合早已不是新鲜事,然而在开发过程中还是遇到一些小问题,本文主要是针对开发过程进行简单总结。(才疏学浅,前后端大神们请轻喷)
<link href="{{ url_for('static',filename='js/platform/vue/iview.css') }}" rel="stylesheet">
<script src="{{ url_for('static',filename='js/platform/vue/vue.min.js') }}" ></script>
<script src="{{ url_for('static',filename='js/platform/vue/iview.min.js') }}" ></script>
<script src="{{ url_for('static',filename='js/platform/vue/vue-router.js') }}" ></script>
<script src="{{ url_for('static',filename='js/platform/vue/axios.min.js') }}" ></script>
var projectModal = new vue({
el: '#project_modal',
data: {...},
methods: {...},
beforeCreate: function () {
...
}
});
var projectView = new vue({
el: '#project_view',
data: {...},
methods: {...},
beforeCreate: function () {
}
});
<i-row>
<i-col span="24">
<Card :bordered="false" dis-hover>
<i-table border :columns="columns2" :data="data2"></i-table>
</Card>
</i-col>
</i-row>
var columns2 = [
{title: '项目名称', key: 'project_name', align: 'center', sortable: true},
{title: '项目级别', key: 'project_risk', align: 'center', sortable: true},
{title: '项目经理', key: 'project_creator', align: 'center', sortable: true},
{title: '计划上线', key: 'plan_online', align: 'center', sortable: true},
{title: '实际上线', key: 'actual_online', align: 'center', sortable: true},
{title: '项目状态', key: 'project_status', align: 'center', sortable: true},
{title: '操作', key: 'project_exec', align: 'center'}
];
{title: '操作', key: 'project_exec', align: 'center',
render: function (h, params) {
var disableFlag = false;
var marginRight = '15px';
if (params.row.is_archive == '已归档'){
disableFlag = true;
marginRight = '5px';
}
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
style: {
marginRight: marginRight
},
on: {
click: function () {
this.projectModal.editShow(params.row.project_exec);
}
}
}, '编辑'),
h('Button', {
props: {
type: 'error',
size: 'small'
},
domProps:{
disabled: disableFlag
},
style: {
marginRight: '5px'
},
on: {
click: function () {
this.projectView.projectFile(params.row.project_exec, params.index, params.row.project_status);
}
}
}, params.row.is_archive)
]);
}
}
本文来自网易实践者社区,经作者朱珊珊授权发布