feat:新增模板库内容 模板库查看LibraryAdd.vue 公告 项目积分 设置

This commit is contained in:
dongwug
2022-10-17 15:24:10 +08:00
parent 050e741d86
commit 26f4f3be34
7 changed files with 753 additions and 16 deletions

View File

@@ -41,14 +41,14 @@
</div>
<div class="tmpl_body">
<div class="tmpl_tabbox">
<!-- <a-table
<a-table
:columns="columns1"
:data-source="tableData1"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:pagination="false"
/> -->
/>
</div>
</div>
</div>
@@ -56,17 +56,143 @@
</template>
<script>
export default {
import { reactive, defineComponent, toRefs } from "vue";
const columns1 = [
{
title: "模版名称",
width: '20%',
dataIndex: "name",
key: "name",
ellipsis: true,
align: "center",
},
{
title: "状态",
width: '15%',
dataIndex: "status",
key: "status",
align: "center",
},
{
title: "创建人",
width: '18%',
dataIndex: "creator",
key: "creator",
align: "center",
},
{
title: "最近学习时间",
width: '25%',
dataIndex: "stutime",
key: "stutime",
align: "center",
},
{
title: "操作",
width: '22%',
className: "h",
dataIndex: "operation",
key: "operation",
align: "center",
},
];
export default defineComponent({
name: "TemplateLibrary",
// import { reactive, defineComponent, ref } from "vue";
// export default defineComponent({
// setup() {
// const state = reactive({
// })
// }
// })
}
setup() {
const state = reactive({
tableData1: [
{
key: "1",
name: "管理者进阶-腾飞班Z1",
status: "已发布",
creator: "李部长",
stutime: "2022-10-31 23:12:00",
operation: "operation",
},
{
key: "2",
name: "管理者进阶-腾飞班Z2",
status: "已发布",
creator: "毛继禹",
stutime: "2022-10-31 23:12:00",
operation: "operation",
},
{
key: "3",
name: "管理者进阶-腾飞班Z3",
status: "已发布",
creator: "毛继禹",
stutime: "2022-10-31 23:12:00",
operation: "operation",
},
{
key: "4",
name: "管理者进阶-腾飞班Z4",
status: "未发布",
creator: "毛继禹",
stutime: "2022-10-31 23:12:00",
operation: "operation",
},
],
});
const getTableDate1 = () => {
let data = state.tableData1;
data.map((value) => {
{
//单层项目
value.operation = (
<div class="operation" style="justify-content: flex-end;">
<div class="nSelect">
{value.status === "已发布" ? (
<div class="nselect">
<div class="ops2">
<router-link to="/libraryadd">
<div class="jc">查看</div>
</router-link>
</div>
<div class="ops3">
<div class="jc">撤回</div>
</div>
</div>
) : (
<div></div>
)}
{value.status === "未发布" ? (
<div class="nselect">
<div class="ops1">
<div class="jc">发布 |</div>
</div>
<div class="ops2">
<router-link to="/libraryadd">
<div class="jc">查看</div>
</router-link>
</div>
<div class="ops3">
<div class="jc">删除</div>
</div>
</div>
) : (
<div></div>
)}
</div>
</div>
);
}
});
state.tableData = data;
};
getTableDate1();
return {
...toRefs(state),
columns1,
}
}
})
</script>
@@ -158,7 +284,21 @@ export default {
}
.tmpl_body{
.tmpl_tabbox{
.operation {
display: flex;
justify-content: center;
align-items: center;
color: #4ea6ff;
.nselect {
justify-content: center;
align-items: center;
display: flex;
.jc {
margin-left: 20px;
cursor: pointer;
}
}
}
}
}
}