126 lines
2.8 KiB
Markdown
126 lines
2.8 KiB
Markdown
# 六盘水烟草
|
||
### 安装依赖
|
||
npm install
|
||
或者,直接解压里面的node_modules压缩包
|
||
### 运行
|
||
npm run dev
|
||
### 打包
|
||
npm run build
|
||
|
||
|
||
|
||
# ================== 组件使用 ==================
|
||
|
||
## 选择单位
|
||
```js
|
||
<!-- 选择单位 -->
|
||
<Choosebm :showDdld="showDept" searchType="03" :zzlx="zzlx" @closezzjg="showDept=false" @listdata="deptChange" />
|
||
|
||
import Choosebm from "@/components/MyComponents/ChooseDept/index.vue";
|
||
|
||
const showDept = ref(false);
|
||
const zzlx = ref(null);
|
||
const deptChange = (val) => {
|
||
fromData.value.responsibledeptname = val.orgName;
|
||
fromData.value.responsibledeptid = val.id;
|
||
}
|
||
```
|
||
```js
|
||
## mosty 组件
|
||
import * as MOSTY from "@/components/MyComponents/index";
|
||
```
|
||
## 标题组件
|
||
```html
|
||
<MOSTY.Assort :title="'基础信息'" />
|
||
```
|
||
|
||
## 编辑和删除 查看
|
||
```html
|
||
<template #actions="{ row }">
|
||
<span class="operedit" @click="handleEdit(row)">
|
||
<el-icon>
|
||
<EditPen />
|
||
</el-icon>
|
||
编辑
|
||
</span>
|
||
<el-popconfirm confirm-button-text="是" cancel-button-text="否"
|
||
icon-color="red" title="确定要删除?" @confirm="handleDel(row)">
|
||
<template #reference>
|
||
<span class="operdel" size="small">
|
||
<el-icon>
|
||
<Delete />
|
||
</el-icon>
|
||
删除</span>
|
||
</template>
|
||
</el-popconfirm>
|
||
<span class="operesee" @click="handleSee(row)">
|
||
<el-icon>
|
||
<Compass />
|
||
</el-icon>查看</span>
|
||
</template>
|
||
|
||
```
|
||
## 文本框调高
|
||
```vue
|
||
:autosize="{minRows:2,maxRows:5}"
|
||
```
|
||
|
||
## 烟草api
|
||
```js
|
||
import { getApi, postApi } from "@/api/tobAcco_api.js";
|
||
```
|
||
## 字典调用方法
|
||
```js
|
||
const { proxy } = getCurrentInstance();
|
||
const { D_TB_NHDJ } = proxy.$dict("D_TB_NHDJ");
|
||
```
|
||
```js
|
||
props.rowItem.orgCode && props.rowItem.orgCode.replace('XN', '')
|
||
|
||
|
||
ssbmid string 所属部门id
|
||
ssbmmc string 所属部门名字
|
||
|
||
<el-input-number v-model="info.fsisBdArea" :precision="2" style="width: 100%" :min="0" />
|
||
|
||
|
||
|
||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon-color="red" title="确定要删除?"
|
||
@confirm="onDelete(row)">
|
||
<template #reference>
|
||
<el-link type="danger">删除</el-link>
|
||
</template>
|
||
</el-popconfirm>
|
||
|
||
// 冒泡排序
|
||
|
||
|
||
|
||
|
||
```
|
||
|
||
### 导入
|
||
```js
|
||
// 导入模板数据
|
||
const uploadFile = () => {
|
||
nextTick(() => {
|
||
fileBtn.value.click()
|
||
})
|
||
}
|
||
<input type="file" style="display: none;" @change="changeFile" ref="fileBtn">
|
||
// 获取文件
|
||
const changeFile = () => {
|
||
nextTick(() => {
|
||
let file = fileBtn.value.files[0]
|
||
if (!file) { return; }
|
||
let data = new FormData()
|
||
data.append('file', file);
|
||
uploadfilApi(data, `/mosty-jcgl/target/batchUpload`).then(() => {
|
||
ElMessage.success("批量上传成功");
|
||
listQuery.pageCurrent = 1;
|
||
getTabList();
|
||
}).finally(() => {
|
||
fileBtn.value.value = ''
|
||
})
|
||
})
|
||
} |