Commit b9bf8ecb authored by 李驰骋's avatar 李驰骋

Merge remote-tracking branch 'origin/dev' into dev

parents 9cbd2448 bea772d2
......@@ -81,17 +81,16 @@
@click="handleAdd"
v-hasPermi="['tm:tmToolRequest:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
<!-- <el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tm:tmToolRequest:edit']"
>修改</el-button>
@click="handlePrint"
>打印</el-button> -->
</el-col>
<!-- <el-col :span="1.5">
</el-col>
<el-col :span="1.5">
<el-button
......@@ -274,8 +273,33 @@
import { listTmToolRequest, getTmToolRequest, delTmToolRequest, addTmToolRequest, updateTmToolRequest } from "@/api/mes/tm/tmToolRequest";
import itemline from "./itemIndex.vue";
import { genCode } from "@/api/system/autocode/rule";
import { io } from "socket.io-client";
import { getToken } from "@/utils/auth";
import SelectTask from "./selectTask.vue";
const socket = io("http://192.168.23.19:17521", {
transports: ["websocket"],
auth: {
token: "Bearer " + getToken(), // 在此处填入你 client 设置的 token,缺省可留空
},
});
socket.on("connect", () => {
globalThis.connect = true;
console.log('连接成功444')
// TODO: Do something for your project
});
socket.on("clients", (clients) => {
globalThis.clients = clients;
console.log(clients, 'clients')
});
socket.on("printerList", (printerList) => {
globalThis.printerList = printerList;
console.log(printerList, 'printerList')
})
export default {
name: "TmToolRequest",
components: {itemline, SelectTask},
......@@ -348,9 +372,20 @@ export default {
};
},
created() {
this.getList();
},
methods: {
handlePrint() {
console.log(socket.emit("getClients"), 'getClients')
socket.emit("news", {
client: null,
printer: null,
type: "url_pdf",
pdf_path: 'http://192.168.23.19:8081/static/123.pdf',
});
},
/** 查询刀模板申请单列表 */
getList() {
this.loading = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment